Zum Inhalt springen

Lektion 6 · Preparing Data

Select Tool and Data Types

Master the Alteryx Select tool and field types, including strings, integers, decimals and dates, plus how to rename, reorder and remove columns safely.

Every column in a workflow has a data type. The type decides what you can do with the values: add them, compare them as dates or treat them as text. Many confusing errors come from a wrong type. The Select tool is where you control it.

With Select you can also rename, reorder and remove columns. Put one early in nearly every workflow.

What the Select tool does

In the Configuration window you see one line per field. For each one you can:

  • Keep it or remove it (tick or untick).
  • Rename it.
  • Change its type and, for some types, its size.
  • Move it up or down to change the column order.

There is also an option for unknown fields, which controls what happens when new columns appear in the input later. If you remove unknown fields, a new column in the source is silently dropped. If you keep them, new columns flow into your outputs. Decide on purpose.

The main data types

Type Holds Notes
Bool True or false
Byte Whole numbers 0 to 255 Cannot be negative
Int16, Int32, Int64 Whole numbers Int16 is -32,768 to 32,767
FixedDecimal Exact decimals You set precision and scale
Float, Double Approximate decimals About 7 and 15 digits of precision
String, WString Fixed-length text WString for any Unicode text; limited length
V_String, V_WString Variable-length text Size adapts to each value
Date, Time, DateTime Dates and times Stored in ISO form, such as 2026-03-31

Other types exist, such as Blob for binary data and a spatial object type for map shapes.

Choosing a type

  • Identifiers and codes (order numbers, zip codes, phone numbers): use text.
  • Counts: use an integer type that is large enough.
  • Money: use FixedDecimal when exact cents matter, with a precision and scale that fit your largest value.
  • Measurements and ratios: Double is usually fine.
  • Text with international characters: use WString or V_WString. String and V_String are for Latin-1 text.

According to the Designer help, the Formula tool converts FixedDecimal values to Double during calculations. Check rounding on financial results, and round explicitly with a function such as Round when you need an exact number of decimals.

Why approximate decimals matter

Python Stand-in: binary floating point versus exact decimals

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The lesson: compare decimals with a tolerance, or use a decimal type and round on purpose.

Truncation

A fixed text type has a maximum size. If the size is too small, values are cut off. The Results window usually shows a conversion or truncation message. Treat it as an error until you understand it.

Python Stand-in: detect values that would be truncated

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The Auto Field tool

Auto Field reads the data and picks small, suitable types. It saves memory, but it must look through the data, and it can make choices you do not want, such as a type or text size that is too small for next month's data. The help says values that start with a zero are kept as text, but still check your codes and identifiers after you run it. For a repeatable workflow, set important types yourself with Select.

Converting text to numbers and dates

You have three common ways:

  1. Select tool: change the type. Values that cannot convert become null or raise a conversion message.
  2. Formula tool: use functions such as ToNumber() or ToString() for control.
  3. DateTime tool or DateTimeParse(): for dates in a format other than ISO (see dates and times).

Before converting, look for currency symbols, thousands separators, spaces and local decimal commas. Clean them first, or the conversion may fail.

A schema record

Write the schema you expect, and check that the workflow produces it:

Field Type Rule
order_id V_String Not empty, unique
order_date Date Not in the future
amount FixedDecimal 19.2 Zero or more
country V_WString From an approved list

This tiny table is a data contract. It helps others understand the workflow and tells you what to test.

Types at the boundaries

Types matter most where data enters and leaves a workflow. At the entry, convert text to the right types as soon as possible, so that errors appear early and close to their source. At the exit, check that the destination accepts your types and sizes. A database column may be shorter than your text, or it may not accept a null.

Two streams can also disagree. When you union or join them, a field that is a number in one and text in the other causes trouble. Put a Select tool on each branch and give both fields the same type, and for a union the same name too.

Document your choices in an annotation. When a colleague asks why store_code is text although it contains digits, the answer is right on the canvas: it is an identifier, and leading zeros matter.

Practice task

Create a Text Input table with an account number that starts with zeros, a price with two decimals, a quantity, an order date and a country name that contains accented letters. Write the schema you want: name, type, size and rule for each field.

Apply it with a Select tool. Then add a row with a value that does not fit, such as text in the quantity column or a very long country name, and read the messages in the Results window. Decide for each problem whether you would change the schema, clean the data or reject the row.

Common mistakes

Do not use a numeric type for a value that you never calculate with. Identifiers stored as numbers lose leading zeros, and very long ones may lose precision in a floating-point type.

  • Leaving all fields as text and sorting numbers alphabetically.
  • Removing unknown fields and losing a new column later.
  • Setting a text size based only on today's data.

Check your understanding

Quick check · 4 questions

of 4 answered You scored / 4 · perfect!

  1. 1. What can the Select tool do?

    Select manages the fields of a stream.
  2. 2. Which type is the best choice for exact currency amounts?

    FixedDecimal stores decimals exactly with the precision and scale you set.
  3. 3. What range can Byte hold?

    Byte is an unsigned 8-bit integer.
  4. 4. Which is a risk of Auto Field in a repeating workflow?

    Types chosen from today's data can be too small or wrong for tomorrow's.

Summary

  • Use Select to rename, reorder, remove and retype fields.
  • Keep identifiers as text and choose numeric types by meaning.
  • Watch for truncation and conversion messages.
  • Decide how to handle unknown fields, and write down the expected schema.

Next: Filter, Sort, Sample and Unique

Dein Fortschritt wird in diesem Browser gespeichert. Kein Konto nötig.