Hello
I have a Fact table in my Warehouse database containing data since
2001 till today. This table is a source table for a Cube also. In this
cube, I want to creata a "Calculated measure" displaying running-total
of the "Quantity" field starting Jan 01, 2003 till today. For dates
before Jan 01, 2003 ,I want to show NULL in this calculated measure.
I have written the following MDX query.
sum(
{StrToMember
(iif(
[time].currentmember.level is [Time].[Day Of Week],"[Time].[Retail
Year].&[2003].&[1].&[1].&[2]",
iif([Time].currentmember.level is [Time].[Retail Week Description],
"[Time].[Retail Year].&[2003].&[1].&[1]",
iif([Time].currentmember.level is [Time].[Retail Month Description],
"[Time].[Retail Year].&[2003].&[1]",
iif([Time].currentmember.level is [Time].[Retail Year],
"[Time].[Retail Year].&[2003]","[Time].[All Time]")) ) ) ):
StrToMember([time].currentmember.uniquename)}
,[Measures].[Quantity])
The problem is that this MDX query fails to show NULL for dates before
Jan 01, 2003. In fact it calculates "negative sum" for the dates
before Jan 01, 2003.
Could anyone please help.
Thanks
I have a Fact table in my Warehouse database containing data since
2001 till today. This table is a source table for a Cube also. In this
cube, I want to creata a "Calculated measure" displaying running-total
of the "Quantity" field starting Jan 01, 2003 till today. For dates
before Jan 01, 2003 ,I want to show NULL in this calculated measure.
I have written the following MDX query.
sum(
{StrToMember
(iif(
[time].currentmember.level is [Time].[Day Of Week],"[Time].[Retail
Year].&[2003].&[1].&[1].&[2]",
iif([Time].currentmember.level is [Time].[Retail Week Description],
"[Time].[Retail Year].&[2003].&[1].&[1]",
iif([Time].currentmember.level is [Time].[Retail Month Description],
"[Time].[Retail Year].&[2003].&[1]",
iif([Time].currentmember.level is [Time].[Retail Year],
"[Time].[Retail Year].&[2003]","[Time].[All Time]")) ) ) ):
StrToMember([time].currentmember.uniquename)}
,[Measures].[Quantity])
The problem is that this MDX query fails to show NULL for dates before
Jan 01, 2003. In fact it calculates "negative sum" for the dates
before Jan 01, 2003.
Could anyone please help.
Thanks