Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2012 Forums
 Analysis Server and Reporting Services (2012)
 MDX Question

Author  Topic 

yomi
Starting Member

25 Posts

Posted - 2014-05-08 : 07:47:42
Hi Guys,

I want to write MDX query to retrive 1 week data.
but for retring 1 week data i want qury like
if it is,
Monay then it will retrive 2 days data i.e sunday and monday
if it is,
Tuesday then it will retrive 3 days data i.e.sunday ,Monday and Tuesday
if it is,
Wednesday then it will retrive 4 dys data i.e.sunday ,Monday and Tuesday
and so on
if query runs on sunday then it will return 1 day data i.e. only for sunday





Yogesh

yomi
Starting Member

25 Posts

Posted - 2014-05-09 : 01:42:38
Hey Anybudy please replay ASAP.

Yogesh
Go to Top of Page

spudsully
Starting Member

2 Posts

Posted - 2014-05-14 : 21:40:06
Yogesh,

If your after an aggregation of a measure then a periods to date would be ok to use pending you have a date hierarchy available that uses Sunday as the start of the week.
sum
(
PeriodsToDate
(
<<Week Level name>>
,<<Current date Member>>
)
,<<Measure Value>>
)
)
Go to Top of Page
   

- Advertisement -