cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with Restricted Key figure!

Former Member
0 Kudos

Hello BW Gurus,

Currently I am having problem with a report that is using a restricted key figure in the formula. When I filter down this restricted key figure, it is working fine but when I use this restricted key figure in formula that calculate greater than value, its giving me wrong figure and when I calculate less then value, its giving me zero total result. I am drilling down this restricted KF on a hierarchy. Did I miss any setting or do I need to do anything extra for this?

Please let me know and thanks in Advance,

Vaghar.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Looks like the problem is with the way you defined the formula. Can you please tell me the requirement and also the your current definition of the formula ?

Former Member
0 Kudos

Hello Sudheer,

Thanks for your response and here is my current definition: I have a restricted key figure called "Count" and I am defining the formula as "Count Greater" = ( 'count' > 100 ) * 'count' and "Count Lesser" = ( 'count' < 100 ) * 'count'.

When I run a report and do a filter on "Count", it is perfect but when I filter on "Count Greater" and "Count Lesser", it is giving wrong total to "Count Greater" and zero total to "Count Lesser".

Am I missing anything here?

Thanks in Advance,

Former Member
0 Kudos

So from what I get you have a restricted key figure "Count" and you are using this RKF in two CKF's which are "Greater Count" (CKF1) and "Lesser Count" (CKF2) ! And you say your definition for

CKF1 = ((Count >100)*Count)

In words this means IF Count > 100 then CKF1 = Count. What abt the else statement ??? If Count < 100 what should be the value of CKF1 ???

Similarly you defined CKF2 such that IF Count <100 then CKF2 = Count. What when Count >100 ???

Can you please tell me your requirement so that I can better assist you. Please let me know if I've misconstrued something. Also there is a SAP Note which talks abt restrictions of using RKF's in CKF's. We shall see if that applies to your case.

Former Member
0 Kudos

Hello Sudheer,

You totally misunderstood! Let me explain you again - I have a RKF called "Count" and I am building a formula to calculate greater than and less than values using this RKF.

Formula 1 = ((Count >100)*Count)

Formula 2 = ((Count <100)*Count)

I am not using or creating any CKF's and they are just formula's.

Let me know if this formula definision is wrong? and the requirement itself is to find the Count value > 100 and Count value < 100 for the user validation.

Thanks in Advance,

Former Member
0 Kudos

There aint much difference between CKF's and Formulae. CKF's are global where as Formulae are local. Other than that the way you define them both would be the same. I am still not clear on your requirement. So you have a RKF and you would like to get a count of the two cases...

Case1 : RKF >100

Case2: RKF <100.

Am I right ?? Lets say you have the value of RKF >100 four times and <100 3 times when you run the query. So you basically want to show two columns GREATER COUNT = 4 and LESSER COUNT = 3. Is this your requirement ??

Former Member
0 Kudos

Yes Sudheer,

You are absolutely right - if I have the value of RKF >100 four times and <100 3 times when I run the query, It should give GREATER COUNT = 4 and LESSER COUNT = 3 but for some reason it is not giving me correct values for greater and lesser count and I am getting value 7 in RKF (4+3) which is correct!

Help me how to resolve this and Thanks in advance,

Former Member
0 Kudos

In that case create two calculated keyfigures CKF1 and CKF2 such that

CKF1 = ((Count >100)*1 + 0)

CKF2 = (Count<100)*1 + 0)

and then define Greater Count as a formula such that

Greater Count = <b><i>Count</i></b> (CKF1)

and similarly Lesser Count = <b><i>Count</i></b> (CKF2).

where <b><i>Count</i></b> is a data function which gives a value of 1 when the operand <>0 and returns a 0 when the operand = 0.

Hope this helps.

Former Member
0 Kudos

Hi Sudheer,

I exactly did the same was you suggested but I am getting either 1 or 0 coz my RKF "Count" values are either 1 or 0. I am filtering the RKF and CFK's as you suggested but drilling down based on hierarchy, which is in the free characteristic.

Any workaround? Thanks for you patients and Thanks in Advance,

Former Member
0 Kudos

i think i have a similar problem:

when i create a global calculated key figure using a global restricted key figure, none of the formulas work when aggregated. they should determine the result of the formula prior to aggregation, but when restricted key figures are used, they don't.

Anyone know?

Answers (0)