September 9, 2011 at 10:01 am
Hi Guys,
I have designed a cube, Now I want to filter Dimension's data using Case statement. Here is the query written but i am getting an error
"The following syntax error occurred during parsing: Invalid token"
Query:
With Member [Measures].
As
Case [OMS Order 1].[Movement Type].[Movement Type].CurrentMember
When [OMS Order 1].[Movement Type].&[PORT TO FTWZ] Then "Import"
When [OMS Order 1].[Movement Type].&[FTWZ TO DTA] Then "Import"
When [OMS Order 1].[Movement Type].&[DTA TO FTWZ] Then 'Export"
When [OMS Order 1].[Movement Type].&[FTWZ TO PORT] Then "Export"
Else "Null"
End
Select {[Measures].,[Measures].[Order Progress Dashboard Count]} on Columns,
{[OMS Order 1].[Office].Members} on rows
from Cube
I am not getting what went wrong
Thanks.....
September 9, 2011 at 11:48 am
Hi Blushan,
can you try the MDX without the slash? Possibly being interpretted as an escape character.
e.g.
With Member [Measures].[IE]
As
Case [OMS Order 1].[Movement Type].[Movement Type].CurrentMember
When [OMS Order 1].[Movement Type].&[PORT TO FTWZ] Then "Import"
When [OMS Order 1].[Movement Type].&[FTWZ TO DTA] Then "Import"
When [OMS Order 1].[Movement Type].&[DTA TO FTWZ] Then 'Export"
When [OMS Order 1].[Movement Type].&[FTWZ TO PORT] Then "Export"
Else "Null"
End
Select {[Measures].[IE],[Measures].[Order Progress Dashboard Count]} on Columns,
{[OMS Order 1].[Office].Members} on rows
from Cube
Steve.
September 15, 2011 at 3:33 am
i have tried both query but nothing comes up...
September 15, 2011 at 8:13 am
In the third "When .. " row, you have a ' instead of " .
Franky Leeuwerck
Franky L.
October 31, 2014 at 1:57 pm
this should work
with member [Measures].[x] as
case [Measures].[measuregroup]
when [Date].[Date Id].&[20110101] then '[Measures].[x]'
else '0'
end
Select [Company].[Company] on 0,
[Date].[Date Id] on 1
from [cube]
where [Measures].[x]
try defaulting to different number other then null
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply