Description
The LessThanEqualGen Generator allows one or more <= conditions. You can use it to evaluate conditions involving numerical or comparable data to determine if a value is less than or equal to another. This generator is also helpful in sibling data generation when dependencies between multiple attributes are needed.
For example:
- if (x <= 1), then select option A
- if (x <= 2), then select option B
- if (x <= 3) then select action C
- if (x <= 4) then select action D
- else select default E
Note: You can also use the EvalGen, which supports other conditions (equal to, greater than, greater than or equal to, etc.). For multiple conditions, you can use the EvalCaseGen or EvalCaseActionGen.
In This Article
Video Training
Generator Parameters
The following parameters may be configured for the LessThanEqualGen Generator. Items with an asterisk* are required.
- reference* - Defines the referenced variable that will be used to determine the condition.
- default* - Defines the value selected if no condition is met.
- conditionList - Defines a list of <= conditions. Values must be integers.
- actionList -Defines the list of actions to be taken when a given condition is matched. Actions may be a constant value or references to another Attribute's generated value.
Example - Check if Spending Amount is within Budget
This example uses a whole number between 0 and 10,000 to see if the generated value exceeds a set budget of 5,000. Two linked generators are used to generate the number value and check if it is less than or equal to 5,000.
RandomGen
Generates a random number between 0 and 10,000.
LessThanEqualGen
Checks generated value (spent amount) to determine if it is less than or equal to the 5000 budget.
If (balance <= 5000)
generate 'Yes'
else generate 'No'
The following parameters have been changed:
- reference - references the RandomGen (gen1) that generates the spending amount.
- default - generates 'No' when no condition has been met.
- conditionList - value is less than or equal to 5,000.
- actionList - generates 'Yes' when the condition evaluates to 'true.'
Note: You can have many conditions with different actions. Conditions and actions can be constant or referenced values.