none
Parllel Period in Set

    Question

  • I am trying to validate a requirment but not sure if i am doing this correctly. 

    I am trying to read pass parameters in the set and get the result set , but everytime i run the query it doesn't show correclty.  I am calling a parllel period in a set and i will be using the value multiple times. 

    I just want to make sure i am reading this correclty , Can you verify  and advise 

    At this point i am not  getting any count and that is not correct

    WITH 
     
    SET FromDate AS
    	StrToMember("[Date].[Calendar].[Date].&[" + FORMAT(Cdate("1/1/2013"), "yyyyMMdd") + "]", CONSTRAINED)
    
    SET ToDate AS
    	StrToMember("[Date].[Calendar].[Date].&[" + FORMAT(NOW(), "yyyyMMdd") + "]", CONSTRAINED)
    
    
    //// Location Population  <= 6 Month(s) starts after start of specified date
    
    SET Test AS	
    
    NonEmpty(Population,
    (
    	{Filter(	
    			[Population].[Population ID].Members,
    				[Population].[Population ID].CurrentMember IS 
    					[Population].[Population ID].[Population ID].[1011])   
    },
    	{(ParallelPeriod([DATE].[Calendar].[Month],6, FromDate.Item(0)):FromDate.Item(0),	
    	[Measures].[PopulationCount])}
    	)
    )
    
    
    
    Member Measures.[TestCount]
    
    As Count(Test)
    
    
    Select Measures.[TestCount] on 0 
    ,[Date].[Date].&[20130301] on 1 
    From [DM_Population]


    ns100

    Saturday, November 16, 2013 12:37 AM

All replies

  • Hi Ns100,

    Thank you for your question. 

    I am trying to involve someone more familiar with this topic for a further look at this issue. Sometime delay might be expected from the job transferring. Your patience is greatly appreciated. 

    Thank you for your understanding and support.

    Regards,
    Charlie Liao

    If you have any feedback on our support, please click here.


    Charlie Liao
    TechNet Community Support

    Monday, November 18, 2013 9:08 AM
    Moderator
  • Hello Ns100,

    Thanks for your post. Because you use the parameters as a set, set.item(0) is a tuple, and set.item(0).item(0) is a member, you can try the following.


    WITH
     
    SET FromDate AS
     StrToMember("[Date].[Calendar].[Date].&[" + FORMAT(Cdate("1/1/2013"), "yyyyMMdd") + "]", CONSTRAINED)

    SET ToDate AS
     StrToMember("[Date].[Calendar].[Date].&[" + FORMAT(NOW(), "yyyyMMdd") + "]", CONSTRAINED)


    //// Location Population  <= 6 Month(s) starts after start of specified date

    SET Test AS

    NonEmpty(Population,
    (
     {Filter(
       [Population].[Population ID].Members,
        [Population].[Population ID].CurrentMember IS
         [Population].[Population ID].[Population ID].[1011])  
    },
     {(ParallelPeriod([DATE].[Calendar].[Month],6, FromDate.Item(0).item(0) ):FromDate.Item(0).item(0) ,
     [Measures].[PopulationCount])}
     )
    )

     

    Member Measures.[TestCount]

    As Count(Test)

    Select Measures.[TestCount] on 0
    ,[Date].[Date].&[20130301] on 1
    From [DM_Population]

    Hope this helps.

    Thanks


    Meer Al - MSFT

    Tuesday, December 03, 2013 3:04 AM