Your First Data Flow
In this tutorial, you’ll create a data flow that generates a sequence of records. We’ll generate a dataset of 100 records containing integers and their squares like this:
Create a new data flow
Open Tweakstreet and close any files that might be open.
Right click anywhere on the flow canvas and select
New to create a new data flow.
This will open a new empty data flow document.
Alternatively you can use the application menu and select
File > New…
Save your flow to file
Save the data flow to file by choosing
File > Save from the main menu.
Add a row generator step
Right click on any free space in the data flow document and select
Add Step. Find the Generate Rows step in the list and click on it to add it to the flow.
Configure the row generator
Double click on the row generator step. This opens the step’s configuration dialog. Rename the pre-configured output field to num and confirm the dialog.
Run the flow
We have now created a minimal data flow that has a row generating step in it. We’re ready to run the flow to see the output.
Right click on an empty spot on the flow canvas, and select “Run using last settings”.
This opens a separate tab in which our data flow executes.
Inspect step output
Our “Generate Rows” step has created 100 rows with a field named num that has the generated row number in it.
Click on the step in the execution tab to see its output.
Close the execution tab
Close the execution tab by clicking on its close symbol. Tweakstreet will switch to the previously active tab. In this case back to our data flow.
Add a calculator step
Right click on the canvas again and select
Add step. Add a calculator step this time.
Connect the steps
We want the rows from the Generate Rows step to move to the Calculator step. To do this, we connect the row generator to the calculator.
There are two methods to connect steps. Pick whichever one you prefer.
Method 1: Press shift and drag
The fastest way to connect two steps is to press and hold the
Shift key, then click on the first step, and drag a connecting line to the second step. Keep the mouse button and shift key pressed until the arrow snaps to the target step.
Method 2: Context Menu
If you prefer working with the mouse only, you can instead bring up the context menu of the first step, select
Connect then click on the target step.
Calculate the square of num
Double click the calculator step to open its configuration dialog.
Add an output field, and name it num_squared.
Set the value of num_squared to
in.num * in.num and confirm the dialog.
We can reference incoming field values as
in.num * in.numshould produce the square of the field coming in from the generator step.
Verify step output
Run the flow again to confirm that our calculator step added a field with the desired value to the process.
You’ve completed your first data flow and have learned the fundamentals of working with Tweakstreet.
You have learned to:
- Create data flows
- Add and connect steps
- Configure steps
- Run flows and inspect processed rows
The following video shows all steps you perform in this tutorial end-to-end: