Icon

Variable Filter Example

<p>The Variable Row Filter is essential when working with many flow variables in a large workflow. It keeps the flow variables "traveling" through the workflow connection in a handy and human-readable size. Some possible use cases include:</p><ol><li><p>Keeping the scope of flow variables precise to where they are needed without passing them to downstream nodes:</p><ul><li><p><strong>Upstream Filtering</strong> is the process of filtering only the necessary flow variables before they enter a component. This clarifies which flow variables are needed inside the component without opening it.</p></li><li><p><strong>Downstream Filtering</strong> is the process of filtering flow variables after they exit a component. This ensures that only the necessary variables are passed on to the rest of the workflow.</p></li></ul></li><li><p>Eliminating unnecessary flow variables after merging variables using the Merge Variables node.</p></li></ol><p>You can download and run this workflow using your locally installed KNIME Analytics Platform. To ensure compatibility, use the latest version of the software.</p><p></p><p>Workflow Steps</p><ol><li><p><strong>Generating Flow Variables</strong></p><ul><li><p><strong>Extract Context Properties</strong>: Output all the properties of the running workflow (name, path, etc.) as flow variables.</p></li><li><p><strong>Data Generator</strong>: Generate a few rows and convert the row values of one column ("Universe_1_1") into flow variables.</p></li><li><p><strong>Variable Creator</strong>: Artificially create six different flow variables, including the "setting" flow variable we want to keep.</p></li></ul></li><li><p><strong>Merging Flow Variables</strong></p><ul><li><p>Merge the more than thirty flow variables generated in the previous step.</p></li></ul></li><li><p><strong>Filtering Flow Variables</strong></p><ul><li><p><strong>Direct Filtering</strong>: Use the Variable Filter node to filter the "setting" variable directly from the Merge Variables node.</p></li><li><p><strong>Mid-Branch Filtering</strong>: Pass the flow variables through nodes like "Table Creator" and "Column Filter," then use the Variable Filter node connected to a table input port to filter the "setting" flow variable. You can connect other nodes with a table input port to the Variable Filter node.</p></li><li><p><strong>Additional Port Filtering</strong>: Add another port (flow variable port) to the Variable Filter node and pass only the "setting" variable along with the one from the recently added port.</p></li></ul></li></ol><p>After filtering, you can pass a clean set of flow variables to downstream nodes and components, ensuring a well-organized and efficient workflow.</p>

Nodes

Extensions

Links