cancel
Showing results for 
Search instead for 
Did you mean: 

Using Condition on formula key figure

Former Member
0 Kudos

Hello Experts,

I have a question on using Conditions in the BW query. I wanted to use a condition on the formula key figure in the query.

I am calculating AGE as difference between input date and date of last movement for a material/batch combination. I want to hide the rows where age < 200 days. I used the condition for this purpose but the problem is the condition works only when I define the condition for the specific characteristics. As soon as I change the drilldown, the condition does not work and displays all the rows.

Can anyone please help me understand how conditions work with key figures that are calculated in the query and is there a way I can make it work indenpendent of the drilldowns in the report? Is it possible to get the desired results working mainly in the query design, not using ABAP or SAP exit, etc.?

Thanks a lot for your help!

Example:

Material Batch Age

M123 B12 230

M345 B45 50

I want to see only first row and hide the second one based on the condition. This works fine if I define the condition on Age with Material and Batch characteristics. But as soon as I add plant (for example) to this report, I see both the rows.

Accepted Solutions (0)

Answers (2)

Answers (2)

skrathore303
Explorer
0 Kudos

Hi Archana,

you can try out this thing.

As your Key figure on which you have put the condition is a difference of two dates. You will have to put both the dates in query result area and hide them.

E.g.

Your CKF is Age = Date1 - Date2

Condition is Age < 200. (Display in case age is greater than 200).

Now what you need to do is Keep Date1 and Date2 in Columns and in there Display property set it as Always Hide.

Thanks

Shubh

Edited by: Shubh Karan Rathore on Apr 15, 2010 2:21 PM

Former Member
0 Kudos

In Query Designer, go to conditions and the characteristic assignments tab. Make the appropriate selections there (e.g. selecting plant).

Former Member
0 Kudos

Hi Khaled,

Thanks for your response!

Plant is just one example, I have many other free characteristics in the report and I did not want to add drilldown by default on all those characteristics. And, when I define the condition on more than what I have in the drilldown, it does not work.

So, if I define the condition for Material, batch and plant, then I have to have plant in the drilldown otherwise I see all the rows. This works fine if the condition is defined on a regular key figure from the multiprovider. The issue is my condition is on something that I am calculating in the query.

Thanks,

Archana.

Former Member
0 Kudos

Hi Archana,

Have you tried the option 'All characteristics in the drilldown independently' in the characteristics assignment,instead of selecting characteristics?Is it not working?

Thanks.

Former Member
0 Kudos

Hi Raja,

Yes, I tried both the options, select all characteristics and then selecting each one independently. Both options do not help on this calculation. They work fine on the standard key figure from the multiprovider, but not on calculation. I even tried to create the Calculated key figure on the multiprovider, but that did not work either.

Thanks for your response!

Archana.

Former Member
0 Kudos

Hi Archana,

I used the condition in my formula keyfigure with that option and it is working fine .Not sure why it is not working for you.Please check the below help link and see whether you get any useful info.

http://help.sap.com/saphelp_nw04s/helpdata/EN/aa/be7e9ace67bc49826fe3a622af54cb/frameset.htm

Thanks.