cancel
Showing results for 
Search instead for 
Did you mean: 

IIF statement in Univere

Former Member
0 Kudos

Hi,

I have written the IIF statment on the measure(key figure) generated from SAPBW and below is the syntax used under the select clause. The error message is the "XML syntax is correct, but the MDX expression is not parsed" and webI report responded with error. Can someone assist on the syntax.

<Expression>

IIF([Measures].[4N3096KVHMMF62NVRT220HNAU] < "-1",1,

IIF([Measures].[4N3096KVHMMF62NVRT220HNAU] > "1",2,

IIF([Measures].[4N3096KVHMMF62NVRT220HNAU] >= "-1",3,

IIF([Measures].[4N3096KVHMMF62NVRT220HNAU] < "-0.5",3,4))))

</Expression>

Thanks,

Regards,

Vysh

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Check this.

<Expression>

IIF(Measures.4N3096KVHMMF62NVRT220HNAU < ,1,

IIF(Measures.4N3096KVHMMF62NVRT220HNAU > 1,2,

IIF(Measures.4N3096KVHMMF62NVRT220HNAU >= -1,3,

IIF(Measures.4N3096KVHMMF62NVRT220HNAU < ,3,4))))

</Expression>

For numbers there is no need to add Double quotations " " in a condition.

Cheers,

Suresh Aluri.

Former Member
0 Kudos

Hi Suresh,

I have made the changes to the syntax both ways like you advised and still the error message is showing up in universe.

&lt;Expression&gt;

IIF(Measures.4N3096KVHMMF62NVRT220HNAU &lt;-1,1,

IIF(Measures.4N3096KVHMMF62NVRT220HNAU &gt; 1,2))

</Expression>

<Expression>

IIF([Measures].[4N3096KVHMMF62NVRT220HNAU] &lt,-1,1,

IIF([Measures].[4N3096KVHMMF62NVRT220HNAU] &gt, 1,2,

IIF([Measures].[4N3096KVHMMF62NVRT220HNAU] &gt, -1,3,

IIF([Measures].[4N3096KVHMMF62NVRT220HNAU] &lt, -0.5,3,4))))

</Expression>

Thanks,

Vysh

Former Member
0 Kudos

Hi,

what is the DB to which your universe is pointing.

If it is of Oracle/SQL server then you can use case statement instead of iif statement.

case when @Select(class\measure object)<=10 then 1 when @Select(class\measure object)>10 then 2 else 0 end