简体   繁体   中英

Regarding Set Variable Informatica Power center

Regarding Set variable guys. We are using the set variable function. in which aggregation type we set it as Max. So its saving the max value in repository.

So what if we want the repository to save the current value.

Will it work if we set the variable data type as string, so that it wont have aggregation type at all?

Thanks, Teja

As you said the value stored in repository depends on ' Aggregation '. If it is Max then the maximum value is considered and if it is Min then the minimum value is considered

Example : initial value of $$VAR1 = 10

SETVARIABLE($$VAR1, MYVAR)

MYVAR from source = 20

First run: Value 20 is assigned to $$VAR1 and at the end of session 20 is stored in repository for Aggregation = "MAX" because 20 is greater than previous repository value ie, 10

MYVAR from source = 05

Second run : Value 05 is assigned to $$VAR1 and at the end of the session the repository retains 20 because 20 is greater than 5

Now if you want to store the current value try the following steps

1) create a workflow variable $$WFVAR1

2) create an assignment task and initialize the workflow variable

$$WFVAR1 = ''

3) Then in the pre-session variable assignment of your session, assign this workflow variable to your mapping variable (With this your mapping variable gets initialized before your session actually starts)

Hence there is no need to worry about the Aggregation parameter, Always your current value will be stored in the repository

Hope this helps

Thanks and Regards

Raj

What is the version of informatica you are using? I checked it on 9.1. Find the attached images. When i choose a mapping variable the aggregation is showing either MIN or MAX, but when i choose Mapping Parameter, then only the aggregation is getting disabled

Regards Raj 在此输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM