Hi, I'm Ask INFA!
What would you like to know?
ASK INFAPreview
Please to access Ask INFA.

Table of Contents

Search

  1. Preface
  2. Function reference
  3. Constants
  4. Operators
  5. Dates
  6. Functions
  7. System variables
  8. Datatype reference

Function Reference

Function Reference

Differences between SETVARIABLE, SETMAXVARIABLE, and SETMINVARIABLE

Differences between SETVARIABLE, SETMAXVARIABLE, and SETMINVARIABLE

When you use SETVARIABLE,
Data Integration
sets the in-out parameter to the last processed value. When you use SETMAXVARIABLE or SETMINVARIABLE, the in-out parameter is set as the highest or lowest value in your data set.
In the following example data set, DEPT_NO is an int type and DEPT_NAME is a string type.
DEPT_NO
DEPT_NAME
1
Human Resources
2
Research & Development
7
Finance
8
IT
5
Marketing
You run a mapping task that includes one of the functions in an Expression transformation. The following table lists the parameter values that result for each function.
Function
In-out parameter value
SETVARIABLE($$p_io_int, DEPT_NO)
5
SETMAXVARIABLE($$p_io_int, DEPT_NO)
8
SETMINVARIABLE($$p_io_int, DEPT_NO)
1
Now consider re-running the same mapping task with the following updated data set:
DEPT_NO
DEPT_NAME
1
Human Resources
2
Research & Development
7
Finance
8
IT
5
Marketing
9
Customer Support
4
Sales
Using these new values, the in-out parameter sets to the following values when you use these functions:
Function
In-out parameter value
SETVARIABLE($$p_io_int, DEPT_NO)
5
Even though the last value processed is 4, the output value remains as 5 because the Max aggregation type selects the higher value.
SETMAXVARIABLE($$p_io_int, DEPT_NO)
9
Since 9 is higher than the previously selected value of 8, the Max aggregation type updates the output value to 9.
SETMINVARIABLE($$p_io_int, DEPT_NO)
1

0 COMMENTS

We’d like to hear from you!