In certain business scenarios, clients may need to extract a value only from the last system opened in a Multi-System configuration. Since the number of systems opened is not known in advance, hard-coding logic for each instance is not feasible.
This method allows you to dynamically identify and fetch the value from the last opened system.
How to Create a Counter for System Tracking
- Add a numeric question inside the Multi-System group.
- Set its default value to 1.
- This question will act as a system counter and will be used in an aggregate function (SUM) to determine the total number of systems opened at runtime.
How to Use a Proposal Attribute to Identify the Last System
To isolate the value from the last system, use conditional logic with the FLOOR() function.
Example scenario:
Assume the following values from each system:
- System 1: 100
- System 2: 200
- System 3: 300
Let N be the total number of systems (i.e., the result of the counter using SUM()).
Apply the formula:
Value * FLOOR(SystemIndex / N)
Result:
System 1: 100 * FLOOR(1 / 3) = 0
System 2: 200 * FLOOR(2 / 3) = 0
System 3: 300 * FLOOR(3 / 3) = 1
Only the last system returns a value of 1, effectively isolating it.
How to Use This in Proposal Calculations
- Define the formula logic inside a Proposal Attribute.
- Use SUM() to add up results across systems.
- Only the last system contributes a non-zero result; all others are zeroed out.
This ensures the final value reflects only the last system's input.