Icon

06. Flow Variables - solution

Flow Variables - Solution

Solution to the exercise 7 for KNIME User Training
- Filtering rows by an attribute value
- Filtering rows by an attribute value that fulfils a condition and that is updated automatically
- Filtering rows based on a user selection
- Creating a component

Annotations and comments
  • Activity I: Flow Variables - Filter the customer data to 1. customers of the "Gold Investment" product 2. customers of the most common product in the data
  • Activity II: Flow Variables - Create a component that allows a user to choose an investment product and filter the data by that product
  • Activity III: Flow Variables (optional) Goal: Create a path variable that automatically has the current execution date in the file name and write the filtered table into a CSV file. 1. Create a flow variable with the execution date (Date&Time Configuration node) Tip: Select "Date" for the setting option type and activate the checkbox "Use execution time". 2. Create a flow variable with the file name, including the flow variable with the current execution date (String Manipulation (Variable) node) Tip: Use the expression: join("product-filtered",$${Sexecution-date}$$) 3. Create a Path flow variable to save the filtered product file in a directory of your choice, using the flow variable created in 2 as file name (Create File/Folder Variables node) 4. Write the filtered table into a CSV file (CSV Writer node) Tip: Use the Path flow variable that you created in 3
  • Activity IV: Flow Variables (optional) Goal: Create a component that allows to select multiple products out of all available products, using a flow variable of type array 1. Remove all columns besides the column Products (Column Filter node) 2. Remove duplicate rows (Duplicate Row Filter node) 3. Transpose the column (Transpose node) 4. Aggregate all products into one Cell (Create Collection Column node) 5. Create an array flow variable with all products(Table Row to Variable node) 6. Create an input option to select multiple products (Multiple Selection Configuration node) Tip: Control the setting option "Possible Choices" via the Flow Variable tab by using the flow variable created in step 5
  • Write product type with execution date
  • Only products column
  • Aggregate values in array
  • Create path flow variable
  • Set execution date
  • Each product only once
  • by Products
  • filter by Products
  • product
  • desc by count
  • Join name and execution date
  • Customer data
  • first row

Nodes

Extensions

Links