Zum Inhalt springen

Lektion 5 · Input and Output Data

Databases, Connections and In-Database Tools

Connect Alteryx to databases safely, compare standard tools with In-Database tools, learn what pushdown means and manage credentials with care.

Much business data lives in databases, not in files. Designer can read from them with the same Input Data tool, and it also offers a separate family of In-Database (In-DB) tools. Choosing between the two affects speed, cost and security.

This lesson explains both approaches and how to keep your credentials safe. A little SQL is very useful here.

Two ways to work with a database

Standard approach. The Input Data tool runs a query, and the result travels to your computer. All later tools work on your computer. This is simple and gives you every tool, but moving millions of rows is slow.

In-Database approach. In-DB tools build a query that runs inside the database. The data stays there until you ask for it. This is often called pushdown.

flowchart LR
  A["Connect In-DB"] --> B["Filter In-DB"]
  B --> C["Summarize In-DB"]
  C --> D["Data Stream Out<br/>bring the result back"]

Filtering and summarizing happen in the database; only the small result is downloaded.

The In-Database category includes tools such as Connect In-DB, Filter In-DB, Select In-DB, Formula In-DB, Join In-DB, Summarize In-DB, Union In-DB, Data Stream In, Data Stream Out and Write Data In-DB. Data Stream In sends data from your workflow into the database, and Data Stream Out brings database results back.

When to push work to the database

Situation Prefer
A huge table, and you need a small summary In-DB
A small lookup table Standard
You need a tool that has no In-DB version Standard, after Data Stream Out
Combining database data with a local spreadsheet Standard, or Data Stream In first

Function names inside In-DB formulas follow the database's own SQL dialect, not necessarily the Alteryx formula functions. An expression that works in a normal Formula tool may fail in Formula In-DB.

The effect of pushdown

The stand-in below compares the number of rows that would leave the database with and without pushdown.

SQL Stand-in: filter and summarize before moving data

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

Four summary rows are far cheaper to move than a thousand, and the gap grows with the table. See GROUP BY if the query is new to you.

Writing a custom query

Even with the standard Input Data tool, avoid SELECT * on a large table. Write a query that lists the columns you need and filters early:

SQL
SELECT order_id, customer_id, order_date, amount
FROM sales.orders
WHERE order_date >= '2026-01-01';

Date literal syntax differs between database systems, so check yours.

Connections and credentials

You can store database connections centrally with the Data Connection Manager (DCM). It keeps a data source together with a credential, so tools can use the connection instead of you typing a password into each workflow. Which connection types DCM supports depends on your version, so check the help.

Follow these rules whatever the method:

  • Use an account with the least privilege that the job needs. A reporting workflow usually needs read access only.
  • Never type passwords into a Comment, a field value or a file name.
  • Before sharing a workflow or package, check that it contains no saved secrets.
  • Ask who may see the data you extract. A local .yxdb copy of a customer table is still customer data.

Be extra careful with write operations. Test against a development database first. An overwrite or a wrong In-DB write can damage a table that many people use.

Dynamic and parameterized queries

The Dynamic Input tool can change a query using values from your data, such as a date range. This avoids editing the SQL by hand. Be careful with text values that come from users: pasting them into SQL can create errors or security problems (SQL injection). Validate values and keep them to an allowed list when you can.

Python Stand-in: validate a value before it reaches a query

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.

Checking what the database receives

When you work in-database, the workflow is a description of a query, so think about the query that results from it. Follow these habits:

  • Test with a limiting condition first, such as one day of data.
  • Ask a database administrator about costs. Some cloud warehouses bill by the data a query reads or the time it runs.
  • Do not browse a huge result unless you need it.
  • Remember that other users share the database. A badly written join can slow everyone down.
  • Document which database, schema and table each connection uses, so that nobody mistakes production for test.

A useful review question is: "If I wrote this as one SQL query, would I be comfortable running it?" If the answer is no, reduce the data first.

Consistency while you read

Tables can change while your workflow runs. If two queries read related tables minutes apart, orders may refer to customers that the other query did not include, or totals may disagree. Where it matters, filter both queries to the same closed period, or ask for a view or snapshot that represents one moment.

Practice task

Imagine a sales table with many millions of rows and a small table of sales regions. Your report needs last month's total per region. Sketch two designs: one that downloads the data and works locally, and one that filters, joins and summarizes before anything is downloaded.

For each design, estimate which rows cross the network, and say which account and permissions the workflow needs. Note what you would have to do first if the region table lived in a spreadsheet instead of the database. Then write the filter for "last month" so that it does not depend on the day you happen to run it.

Common mistakes

  • Pulling a whole table and filtering afterward.
  • Mixing In-DB and standard tools without the stream tools in between.
  • Assuming that Alteryx and the database treat text case or nulls the same way.
  • Leaving production credentials in a shared workflow.

Check your understanding

Quick check · 3 questions

of 3 answered You scored / 3 · perfect!

  1. 1. What does pushdown mean?

    In-DB tools build a query that the database executes.
  2. 2. Which tool brings In-DB results back into the standard workflow?

    Data Stream Out moves results out of the database stream.
  3. 3. What account should a read-only reporting workflow use?

    Least privilege limits the damage from mistakes and leaks.

Summary

  • Standard tools move data to your computer; In-DB tools run the work in the database.
  • Filter and summarize early, especially on large tables.
  • Data Stream In and Data Stream Out move data into and out of the database.
  • Use managed connections, least privilege and care with writes and parameters.

Next: Select Tool and Data Types

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