on 2024 May 08 9:48 AM
Hello Planning Gurus,
I got a general question on how the data is processed in data actions. Coming from BW my thinking was that a data action loops thru the data and executes on every record the data action code sequentially (like a BW start routine would do).
However, recently code of one data action acted weired (see long text bellow) and I wonder if I was thinking wrong all the time and there is no overall loop but the code is simply executed sequentially and is resulting in selection based loops.
So your memberset makes the first select. If you have an if statement for a particular month this is then selected from the memberset result and the if statement block is executed on that selected data (now in a loop) and written back if there is any data() command.
Next if statement is again selecting data from the memberset result (could overlapp with previous if statement) and executed...
Is this how an data action works?
Thanks and best regards
Axel
Data Action Problem that triggered the question in regards to processing
---------------------------------------
I got a data action that is calculating the difference Q1 to Q1 previous year using variablemembers for a monthly planning model.
Request clarification before answering.
I think its the they way SAC aggregates the result. When you say
this IF evaluates to true for January February and march and the difference of each month from last year is aggregated as they are within same IF block and written to [d/Measures]=#QTR_VARIANCE_Q1,[d/Monat]=#QTR_Q1
Now coming to this one . Remember SAC evaluates statement sequentially
IF [d/Monat].[p/MONTHDESC]="Nov" THEN
DATA([d/Measures]=#QTR_VARIANCE_Q4,[d/Monat]=#QTR_Q4)=RESULTLOOKUP([d/Measures]="REV")+(RESULTLOOKUP([d/Version]=%REF_VERSION_Q3Q4%,[d/Measures]="REV",[d/Monat]=PREVIOUS(12))*-1)
ENDIF
IF [d/Monat].[p/MONTHDESC]="Dec" THEN
DATA([d/Measures]=#QTR_VARIANCE_Q4,[d/Monat]=#QTR_Q4)=RESULTLOOKUP([d/Measures]="REV")+ (RESULTLOOKUP([d/Version]=%REF_VERSION_Q3Q4%,[d/Measures]="REV",[d/Monat]=PREVIOUS(12))*-1)
The December calculation will overwrite the November calculation because of the sequence and they being separate IF block but same write intersection [d/Measures]=#QTR_VARIANCE_Q4,[d/Monat]=#QTR_Q4
So either do DATA.APPEND() for December IF Block or change your IF condition to
IF [d/Monat].[p/MONTHDESC]="Nov" OR IF [d/Monat].[p/MONTHDESC]="Dec" THEN
DATA([d/Measures]=#QTR_VARIANCE_Q4,[d/Monat]=#QTR_Q4)=RESULTLOOKUP([d/Measures]="REV")+(RESULTLOOKUP([d/Version]=%REF_VERSION_Q3Q4%,[d/Measures]="REV",[d/Monat]=PREVIOUS(12))*-1)
ENDIF
Hope this helps !!
Nikhil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
45 | |
9 | |
8 | |
6 | |
5 | |
5 | |
4 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.