on 04-02-2008 10:42 PM
Hi,
Can we copy 0 or null to auxiliary key figures?
Here is my case:
I have a key Figure KF1 with value 10.
I am copying this value to KF1_X in a start macro and in exit macro, I am comparing the value of KF1 and KF1_X and only if there is a change, I am doing a calculation.
Now my problem is :
In case when
KF1........0
KF1_X.....null
also if
KF1.....null
KF1_X....null.
In both the cases when the KF1 is either 0 or null, the auxiliary key figure KF1_X is null. This is giving me hard time to find out whether there was a change or not. 0 and null are two different values as per our scenario.
If the KF_X is a planning area key figure, then I won't have any problem but adding another key figure at this stage of project is not possible.
Can somebody suggest me how to show null in KF1_X when there is null in KF1 and 0 in KF1_X when KF1 is 0?
Hope I am clear here.
Thanks.
KF1 can distinguish between null and 0 because of its planning area setting.
Auxilliary KF cannot do this and hence you cant compare
i assume someone would have keyed in a blank
what you can use is the Macro - is_initial which can distinuish between 0 and blank in the KF1
So you can use the difference between if is_initial = 1 and if KF = 0 and is_initial= 0 and KF = 0
*****************
IS_INITIAL()
Syntax
IS_INITIAL( Key Figure )
Key Figure: Row, column, or cell element (data source = row attributes)
Description
The IS_INITIAL function returns the value 1 if the cell is initial. (The column results from the current step iteration; the row is determined by the Key Figure parameter.) Apply this function for key figures that can distinguish between zero values and initial values. This function is not available if the compatibility mode is activated for the macro book.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
"So you can use the difference between if is_initial = 1 and if KF = 0 and is_initial= 0 and KF = 0"
Can you elaborate this?
Are you asking me to compare when IS_INITAL(KF) =1 and KF =0 and IS_INITAL(KF) =0 and KF =0?
How can I do that?
or do you mean
when IS_INITAL(KF) =1 and Auxiliary KF =0 and IS_INITAL(KF) =0 and Auxiliary KF =0?
In the second case, the system is not able to distinguish between 0 and null and so it is not doing any thing.
Please let me know if I am going wrong somewhere.
Thanks.
well
since you need your auxilliary KF for comapring between what the KF1 was and what KF_X is,
use another auxillary KF_Y that does
when IS_INITAL(KF) =1 and KF =0 then KF_Y = 1
when IS_INITAL(KF) =0 and KF =0 then KF_Y = 2
when you do your calculation, in addition to whether KF = KF_X also chechk if KF_Y is 1 or 2
if 1 then calculate, else done
hope that helps
User | Count |
---|---|
9 | |
4 | |
3 | |
2 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.