cancel
Showing results for 
Search instead for 
Did you mean: 

IF else condition in Universe based on Bex Query

Former Member
0 Kudos

Having issues with creation of if statement in universe (Created on top of bex query.)

I am getting a dimension [Country Key].  need to create a IF else statement on it. like(if([Country Key])='US01/US11' then 'Unites States' else [Country Key]

after going through this post IF ELSE condition in Universe for Source: SAP-B... | SCN i created below statement

<EXPRESSION>IF(@Select(Region\Country Key)='US01/US11','United States',@Select(Region\Country Key))</EXPRESSION>

but its throwing an error, is some thing wrong with my XML syntax??

Using UDT 4.1

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Kumar,

If you notice carefully in the post you mentioned, IIF has been used as a keyword whereas you are using IF.

Try with IIF and check.

Regards,

Yuvraj

Former Member
0 Kudos

Hi Yuvraj,

I used the below statement

<EXPRESSION>IFF(@Select(Region\Country Key)='US01/US11','United States',@Select(Region\Country Key))</EXPRESSION>

But its still giving the error

Any issue with format?

Former Member
0 Kudos

Kumar,

Can you use IIF instead of IFF and check?

Regards,

Yuvraj

Former Member
0 Kudos

Tried both IIF and IFF but getting the same error

Former Member
0 Kudos

Hi Kumar,

As Yuvraj said, you have to use IIF.

Please do not forget that anMDX calculated expression based on SAP BW must always return a numeric value.

Here is a link to "OLAP universes best practices" I published in 2009 with my SAP Account: http://www.sdn.sap.com/irj/boc/go/portal/prtroot/docs/library/uuid/c0a45246-ce76-2b10-e688-f5c820620...

There are plenty of examples to use expression in OLAP universes.

Regards,

Didier

Former Member
0 Kudos

Hi Didier,  It worked, when i am trying to make condition on measures its working perfect.

what if i need to return a character/string as output of the IIF condition?

Thanks,

Kumar

Answers (0)