February 1, 2013 at 7:48 am
Hi,
I'm trying to something that I think should be straight forward in MDX but i'm struggling. I'm new to MDX so it seems trivial but may not be....
Consider the following query:
SELECT
[Measures].[Thing Count] ON 0,
YTD([Effective Date].[Year-Week].[Week].[2013 Week 6]) ON 1
FROM
[Cube]
This gives me a result set that shows as per the attached. All i really want though is the SUM of the rows. How do i do that? It's driving me nuts because i'm sure it's a piece of cake.
Thanks,
Simon
February 3, 2013 at 3:04 pm
Try something along the lines of
With Member [Measures].[Thing Count YTD] As
Sum(YTD([Effective Date].[Year-Week].CurrentMember)
, [Measures].[Thing Count] )
SELECT
[Measures].[Thing Count YTD] ON 0,
[Effective Date].[Year-Week].[Week].[2013 Week 6] ON 1
FROM
[Cube]
Mack
February 4, 2013 at 1:55 am
That's great thanks!
April 18, 2013 at 10:42 am
Try this also...
With Member [Measures].[Thing Count YTD] As
AGGREGATE(YTD([Effective Date].[Year-Week].CurrentMember)
, [Measures].[Thing Count] )
SELECT
[Measures].[Thing Count YTD] ON 0,
[Effective Date].[Year-Week].[Week].[2013 Week 6] ON 1
FROM
[Cube]
This keeps whatever it is you are counting from being double counted.
----------------------------------------------------
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply