none
Named Set in SSAS for from and To Dates. RRS feed

  • Question

  • Hi,

          I need to create the NAMED SETS in SSAS 2008 from retriving the  3 previous weeks, current week, 3 next week..

    Can any one help..

    If select 9 th week then the out put must be     6,7,8,9,10,11,12,13 weeks

    Thanks,

    Avula.GK.


    Avula.GK

    Monday, September 17, 2012 11:45 AM

Answers

  • Finally i got the answer ....

    {linkmember([Start Date].[Year -  Quarter -  Month -  Date].currentmember, [Date].[Year -  Quarter -  Month -  Date]) :   linkmember( [End Date].[Year -  Quarter -  Month -  Date].currentmember,
    [Date].[Year -  Quarter -  Month -  Date])}

    Thanks,

    Avula.GK


    Avula.GK

    • Marked as answer by Avula.GK Tuesday, October 9, 2012 4:16 AM
    Tuesday, October 9, 2012 4:16 AM

All replies

  • Hello Avula,

    Refer the below sample code from adventure works to create a set for the given week. Hope this helps.

    WITH SET Myweekset
    as
    head
    (
    lastperiods
    (
    4,
    [Date].[Calendar Week of Year].&[16]
    )
    ,1
    ).item(0):[Date].[Calendar Week of Year].&[16].lead(3)
    select Myweekset  on 0
      from [Adventure Works]
      

    Monday, September 17, 2012 2:22 PM
  • Hi sorna kumar,

    Thanks, for your reply... i need one more clarification can can u give the  Named set for from and to date range  measures.

    I tried much more in performance point services but all in vein..., i passed parameter for From and TO dates in PPS it works ..., but i cant do any drill down option in pps if i am passing parameter..

    So please help me in named set.

    Thanks,

    Ganesh.


    Avula.GK

    Tuesday, September 18, 2012 11:13 AM
  • Hi Avula.GK.,

    You can use LastPeriods(MDX) function in Named Set to achieve your target, please refer to the similar article:
    http://elonblackman.wordpress.com/2009/01/29/mdx-to-return-current-week-ssas/ 

    Please feel free to ask if you have any question.

    Thanks,
    Eileen


    Please remember to mark the replies as answers if they help and unmark them if they provide no help. This can be beneficial to other community members reading the thread.


    • Edited by Eileen Zhao Wednesday, September 19, 2012 7:21 AM
    Wednesday, September 19, 2012 7:16 AM
  • Dear Eileen,

     Can you help in  Named set for from and to date range  measures.

    I tried much more in performance point services but all in vein..., i passed parameter for From and TO dates in PPS it works ..., but i cant do any drill down option in pps if i am passing parameter..

    Please suggest which is correct way to solve this problem either in PPS or by Named Set...I will be thankful.. if u help in this manner...

    Thanks,

    Avula.GK.


    Avula.GK

    Thursday, September 20, 2012 4:16 AM
  • Finally i got the answer ....

    {linkmember([Start Date].[Year -  Quarter -  Month -  Date].currentmember, [Date].[Year -  Quarter -  Month -  Date]) :   linkmember( [End Date].[Year -  Quarter -  Month -  Date].currentmember,
    [Date].[Year -  Quarter -  Month -  Date])}

    Thanks,

    Avula.GK


    Avula.GK

    • Marked as answer by Avula.GK Tuesday, October 9, 2012 4:16 AM
    Tuesday, October 9, 2012 4:16 AM