Skip to Content
0
Former Member
Nov 08, 2005 at 05:34 PM

How to Accomplish If Then Else Logic in a BEX Query

154 Views

Hello All,

I am trying to interrogate a value in BEX (BW 3.5) after executing a query. Here are the values:

X = 80

Y = 110

Z = 140

X, Y, and Z are all key figures in my infocube.

I need to do if / then / else logic in BEX. I need to determine the smaller of Y or Z. The logic goes like this:

If Z is less than Y, then Z / X.

If Y is less than Z, then Y / X.

Questions:

1. Can I use the formula editor in BEX by doing a right click on my key figure structure and create a New Formula? If so, what standard functions can I use to accomplish this? I couldn't get the Boolean operators to work the way I need them to.

2. Or, do I need to create a formula variable, use CMOD, and use the Global Variable ABAP - customer exit - RSR00001, which uses include statement ZXRSRU01? I'm not sure how this would work because my understanding is that this code will evaluate data at a record level when I need to interrogate Y and Z at a summary level after the query has been executed.

Thanks for any information you have!