Quantcast
Channel: SQLServerCentral » Data Warehousing » Analysis Services » Latest topics
Viewing all articles
Browse latest Browse all 1341

MDX IIF always evaluates to second argument

$
0
0
Hi everyone, I am stuck in this situation and it is getting the better of me. This should be obvious and easy but I am seeing a weird behavior with mdx iif statement. Irrespective of the condition(1st argument), it always evaluates to the second argument. Below is a code snippet -THIS = IIF ([Item].[Price Segment].CurrentMember IS [Item].[Price Segment].&[L], IIF ([Measures].[Month Rolling JOD] > 0.19,1, NULL), IIF ([Measures].[Month Rolling JOD] > 0.32, 1, NULL) );In the above code, irrespective of [Price Segment] value, it evaluates the second argument. I thought this to be an issue with the comparison so I tried different ways. 2nd way -THIS = IIF ([Item].[Price Segment].MemberValue = 'L', IIF ([Measures].[Month Rolling JOD] > 0.19,1, NULL), IIF ([Measures].[Month Rolling JOD] > 0.32, 1, NULL) );3rd way -THIS = CASE [Item].[Price Segment].MemberValue WHEN 'L' THEN IIF ([Measures].[3 Month Rolling POD] > 0,19,1, NULL) ELSE IIF ([Measures].[3 Month Rolling POD] > 0.32 1, NULL)END ;In all the ways, it is always 2nd argument that is evaluated. Even if [Item].[Price Segment] is L.This is a SOS situation. Any help is greatly appreciated folks.

Viewing all articles
Browse latest Browse all 1341

Trending Articles