General examples

These illustrate FlowHeater's basic functions

  • Format numbers as character strings

    This example describes the standard method to transform numbers into strings and how FlowHeater can be used to sidestep the standard format options of the WRITE Adapter.

    Learn more...

  • Simple If-Then-Else example

    Here we see a short and simple example of how a conditional branch is defined in practice, demonstrating the use of the If-Then-Else Heater.

    Learn more...

  • Complex If-Then-ElseIf example

    This example primarily focuses on describing in greater detail the use of the If-Then-Else Heater and to demonstrate a much more elegant possibility of how such relatively complex structures (9 heaters in this case) can be replaced using a single .Net Script Heater.

    Learn more...

  • Example of filtering and grouping data

    This example demonstrates how data can be filtered and grouped during a transformation.

    Learn more...

  • An example of how to filter and group data, as well as how to consolidate grouped values

    This example describes how data can be filtered, grouped and values summed across groups during a transformation. As input let us assume the following small flat file, a report format text file (we do not always have CSV data).

    Learn more...

Simple If-Then-Else example

Here we see a short and simple example of how a conditional branch is defined in practice, demonstrating the use of the If-Then-Else Heater.

All examples are contained in the FlowHeater ZIP archive downloaded and accompany the software as complete Definition files that can be opened directly in Designer.

If-Then-Else example
If-Then-Else example

This example inputs the following short CSV text file on the READ side:

1;first product;$10.50;10
2;second product;$20.56;4
3;third product;$33.66;14

The first field is the Product number, the second is the product Description, the third is the unit Price and the last field indicates the quantity remaining as Inventory. The first three fields are copied to the WRITE Adapter verbatim.

In this example we are only concerned with the Inventory field. If the Inventory is less than or equal to five, we want to write a notice into the field that the product should shortly be reordered.

 

If-Then-Else condition
If-Then-Else condition

Conditions:

The conditions are defined for the If Then Else Heater by using a double click on the Heater icon to open the properties window. In our case, we need only define one condition here. If the Inventory field contains a number greater than five (>5) then the field should be copied verbatim to the WRITE Adapter. However, if this is not the case and the value is less than or equal to five then the text "Inventory <= 5, product must be reordered" should be written to the Inventory field. Note: Since a numeric comparison of the incoming STRING data should be performed, the Change Data Type (INT) option is checked.

 

Then:

Here we have to use a little trick. Since the Inventory field is already connected to the If-Then-Else Heater as the first parameter, the value to be tested, we also need to insert a Clone Heater to replicate the Inventory value as the second If-Then-Else Heater input parameter, which is used to pass this value on when the condition is true.

 

Else:

The static text message stating "Inventory <=5, product must be reordered" is derived from an X-Value Heater as the third If-Then-Else Heater input parameter.

 

 

Tip: With a single click on the If-Then-Else Heater you can discover the input parameter sequence in Designer.

 

 

Stay up to date

Newsletter Registration