Skip to content

Lesson 4 ยท Input and Output Data

Output Data and Alteryx File Formats

Write results with the Alteryx Output Data tool, choose between yxdb, CSV and Excel, handle existing files safely and learn the main Alteryx file extensions.

A workflow is useful only if its results reach the next person or system. The Output Data tool writes data to files and databases. It can also destroy data when it overwrites something, so this lesson treats it with respect.

You will learn the common formats, the choices about existing data, and the Alteryx file extensions you will see in a project folder.

Choosing a format

Format Good for Watch out for
.yxdb Passing data between Alteryx workflows Other programs generally cannot read it
.csv Exchange with almost any system No types, delimiter and encoding must match
.xlsx Sharing with spreadsheet users Row limits, formatting is not the point
Database table Shared, governed data Needs permissions and a write option

.yxdb is Designer's own data file. It keeps the column names and types, so it is a good choice for intermediate results. If a slow step produces data that many workflows need, write it once as .yxdb and read it back.

CSV loses types. Dates and decimals become text, so document the formats that the receiving system expects.

What happens to existing data

The Configuration window offers choices that depend on the destination. For files you may see actions such as overwriting an existing file or sheet. For databases, the common choices are to create a new table, append to an existing table, or overwrite it by dropping and recreating it. Some connections also offer update options, or a way to empty an existing table and then load it (for example Delete Data & Append or a truncate option). The exact labels differ between versions and connection types.

Writing to a database table

Create new Does not replace a table
Append Old rows stay
Overwrite Old table is replaced

Read the exact option text before running

1 / 2

Appending has a classic trap: if you run the same workflow twice, the same rows are added twice. Plan how to prevent that, for example by deleting the period you are about to load, or by checking for existing keys.

SQL Stand-in: running an append twice duplicates rows

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

In a real database, ask your administrator about transactions: you want the delete and the load to succeed or fail together.

Dynamic file names

Sometimes you want one file per region or per month. The Output Data tool can take part of the file or table name from a field in your data. If your data has a region field, rows for each region can go to separate files. Check the values first: characters such as slashes are not valid in file names, and blank values create odd names.

Python Stand-in: make safe file names from a field

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.

Alteryx file extensions

These are the extensions you will see:

Extension What it is
.yxmd A workflow
.yxmc A macro
.yxwz An analytic app
.yxzp A packaged workflow with its files
.yxdb Alteryx data file

You will meet macros and apps later. Packaging explains the .yxzp file.

Output checklist

  • Is the destination the test location while you develop?
  • Will a second run create duplicates or erase something important?
  • Do receivers know the delimiter, encoding and date format?
  • Are there sensitive columns that should not be written?
  • Does the record count match what you expect?

An overwrite option can replace a file or table without asking at run time. While developing, point outputs to a scratch folder or a test schema. You can also turn on the workflow runtime setting that disables tools that write output while you experiment.

Verifying what you wrote

After a run, read the output back or query the table. Compare the row count and a few totals with the data just before the Output Data tool. A control total is a cheap test: for example, the sum of amount should be equal before and after writing.

Planning a load

For a recurring load, decide the grain of the destination first: what does one row mean? For example, "one row per store per month". The grain tells you which columns together form the key, and therefore how to detect duplicates.

Then choose a loading pattern:

Pattern How it works Good for
Full replace Rebuild the whole table each run Small reference tables
Replace one period Remove one month or day, then add it Periodic facts
Append new keys only Compare keys with the destination and add the missing ones Logs and events
Update existing and insert new Change matched rows and add the rest Master data, if your connection supports it

To append only new keys in a workflow, join the incoming rows to the existing keys and keep the output that holds incoming rows without a match. You will learn the Join tool later in this course.

Write the chosen pattern in a comment next to the output tool. The next person then knows whether running the workflow twice is safe.

Practice task

Plan the output for a daily stock report. Decide the format for the warehouse team, the format for a later Alteryx workflow and the file naming pattern. State what one row means, and what happens if the workflow runs twice on the same day.

Then build a tiny version: write three rows to a scratch folder, run it again and open the result. Did the second run replace the file, add rows or fail? Record what you observed together with the exact option you selected. Finally, read the file back in a second branch and compare its row count and total quantity with the data before writing.

Common mistakes

  • Writing to the same file that the workflow is reading.
  • Using .xlsx for very large data, then losing rows or performance.
  • Overwriting an output that colleagues still need.
  • Forgetting that a CSV reader on another computer may expect a different delimiter.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Which format is Designer's own data file and keeps field types?

    yxdb stores names and types and is meant for Alteryx workflows.
  2. 2. What is the main danger of an append option?

    Appending keeps old rows, so repeated runs create duplicates.
  3. 3. Which extension is a packaged workflow with its dependencies?

    yxzp is a zipped package; yxmd is a workflow and yxmc is a macro.
  4. 4. What is a simple way to verify an output?

    Control totals catch lost or duplicated rows.

Summary

  • Use .yxdb between workflows, and CSV, Excel or databases for others.
  • Understand create, append and overwrite before you run.
  • Field-based file names need clean values.
  • Test in a scratch location and verify with counts and control totals.

Next: Databases, Connections and In-Database Tools

Your progress is saved in this browser. No account needed.