Configuration Variables can be used as dynamic variables (sometimes thought of as macro variables) whose values can be used throughout multiple areas of LityxIQ. They allow you to configure parameters or inputs to a process that are easily changeable from one run to the next, so that you do not have to manually change the value in all places where it was used. They can also be used to track a process flow, or kickoff the execution of objects within a flow.
There are three ways to create a Configuration Variable:
- Manually
- Automatically based upon data in a dataset (either a raw dataset or a derived dataset)
- Dynamically based on the execution status of a dataset or other object
Creating a Configuration Variable Manually in the Lityx IQ Interface
In Data Manager, select and click on “Configuration Variables”.
LityxIQ will show a list of all current configuration variables and their values in the current project. You can edit any current names or values by clicking in the table and changing data by typing. Hit enter to finish changing the data in a cell. You can also delete a configuration variable by selecting it, then clicking the Delete Selected Variable button.
To create a brand new configuration variable, use the boxes at the top of the table with the text "Enter Variable Name" and "Enter Current Value". Enter a name and value in these boxes and hit Enter.
In all cases (editing, deleting, or creating a new configuration variable), you must click Save All Changes to have the changes take effect.
Creating a Configuration Variable Automatically Based on Data in a Dataset
Often, you will want to create a Configuration Variable during a multi-step process and save the created value to be used in later steps. This is a dynamic method for creating configuration variables. Note the first two steps below relate to creating configuration variables based on data in a derived dataset. Skip to Step 3 if you have configuration data in a raw dataset.
- Create two new fields to generate a reference to the Configuration Variable name and the Configuration Variable value. In this example, “Mail Date” from the input file contains the value that we want to save as the configuration variable value:
- Since there are often several records on an input file, and there may be multiple values for the configuration variable of interest, use the aggregation function to specify the value of interest. The aggregation variable is the newly created field name that will be stored as the configuration name variable. The value of interest from the input file is the summary variable, which will later be referenced as the configuration value variable:
3. To ensure configuration variables are created from this dataset, use the Configuration Dataset Setting options. This is found in the Finalize & QC area of a view, or in the Dataset Source settings for a raw dataset. Details are described here: https://support.lityxiq.com/110354-Configuration-Dataset-Settings-Options. Be sure to check the “Use this Data as Configuration Variables” box in either case.
At the completion of this process, you should have a 1 row, two column dataset, and you will notice this configuration variable name/value combination on the configuration variables list.
Creating a Configuration Variable Dynamically Based on Execution Status
See this article for more information: https://support.lityxiq.com/110354-Configuration-Dataset-Settings-Options
Using a Configuration Variable
When referencing a configuration variable elsewhere in LityxIQ, put curly braces around the configuration variable name along with the @ symbol.
For example, if you have a configuration variables named "ProcessingDate", you would reference its value with the code {@ProcessingDate}.
This reference can be used almost anywhere in LityxIQ where you can enter text. Most commonly, they are used in New Field definitions (see example below), in Filters, or in creating filenames (such as export files).
When a configuration variable is referenced like this, its value at the time is replaced directly in that position in the code. So, as in the example below, if you require it to be used in the sense of a string, you would place single quotes around it in a New Field definition (see example below), just like you would put quotes around any string. If you are using a configuration variable's value in a numeric setting, do not put single quotes around it.
Example
In this example, we have a dataset with city name, state and a mailing quantity, and we want are creating a derived dataset in which we will create a new field named "Latest Mail Date". We want this field to contain the value of the configuration variable "Creative Mail Date" referenced above for all records. The New Field definition would look like the following:
After executing the derived dataset, the value stored in the Configuration Variable “Creative Mail Date” field gets assigned to all rows in the newly created dataset.
City |
State |
Quantity |
Latest Mail Date |
Barrington |
Illinois |
5,000 |
2018-04-25 |
Skokie |
Illinois |
3,000 |
2018-04-25 |
Hammond |
Indiana |
4,000 |
2018-04-25 |
Racine |
Wisconsin |
6,000 |
2018-04-25 |