Extract data from the country with the highest number of sold items. It is easy to find the country with the highest number of sold items with: - a GroupBy node to calculate the number of sold items as sum(Quantity) by country; - then a Sorter node to sort the countries by decreasing number of sold items; - and finally a Row Filter node to extract only the first row (country) from the sorted list. Such country name now needs to be converted into the Value of a Flow Variable to overwrite the setting in the Row Filter node that extracts the data fro a given country.
Extract data for a given country, calculate sum(amount), rename sum(amount) with the country name. Make the country a parameter. Parameters in a KNIME workflow are called Flow Variables. You can create flow variables at the workflow level as global flow variables (that is visibile throughout the whole workflow) or you can create them with Quickform nodes, that is as local flow variables. The simplest Quickform nodes are the "Input" nodes. Here we use a String Input node.
This workflow shows how to use workflow variable connections to control the execution order of nodes.
Note that the first top most meta node is used to define the location of the data base file depending on the current system. This is not necessary when writing to a "real" data base.
A workflow demonstrating how to use variables in a Java Snippet node.