cancel
Showing results for 
Search instead for 
Did you mean: 

If / Else / Then Statement

Former Member
0 Kudos

I have a requirement where if a key figure falls within a range, it will be assigned a specific string value. For example:

Key Figure Value Bracket

0-100 B1

100-200 B2

200-300 B3

300-400 B4

400-500 B5

etc...

I'm attempting to avoid making back end changes to do this and would rather use Query Designer.

If I do this as an embedded object in a workbook instead (with if/then statements), I'd like to avoid using macros. I'd also have an issue with making the column length dynamic in order to fill the new column to the same length as the key figure column that it's referencing.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

if statements are created as follows in BEx query designer:

(0 <= "key figure" < 100) * "your "new" value" + (100 <= "key figure" < 200) * "your "new" value" + ...

Former Member
0 Kudos

Yeah, I've tried that, but you're only allowed to enter in numeric values for the "new value"

Former Member
0 Kudos

indeed, as it is a key figure

how about the use of a virtual characteristic?

Former Member
0 Kudos

I'm not sure what those are. Could you explain? Is this something that's done at the query level or the cube level? Thanks.

Former Member
0 Kudos

well, basically a virtual characteristic is a characteristic which value is picked up at query runtime

have a look at this document: [https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e051fda8-71a9-2a10-ac9e-8d17414a8c8c]

it goes through all the necessary steps and has some explanation as well

Former Member
0 Kudos

Darn, I was trying to avoid doing backend changes, but it looks unavoidable. Thanks for the help.

Former Member
0 Kudos

well, if you really don't want to do back end changes... how about using my first suggestion, and then replacing the "values" afterwards with Visual Basic coding?

it's dirty, but doable... you'll have to be VERY carefull though... in your VB code you have to make sure ONLY to replace values in the correct column

Answers (0)