4 Replies Latest reply: Jan 31, 2013 11:38 PM by Khadar basha shaik RSS

    Variant of YTD: Generating a table of YTX where X is from a list of dates ... How?

      Hi,

       

      I have a fact table of sales with dates that I would like to be able to use to generate a corresponding table showing the YTD values for each date.  This should be interactive and correspond to whatever possible selected dimension combination -- and be independent of the date selected. 

       

      Q1: What should a set analysis expression look like for computing the year-to-date cummulative YTX value, where X is a static end date on the table?

      Q2: Would the expression need to be different if dealing with weekly data vs monthly data?

       

      Thanking in advance for your help.

       

      As a specific example, I would like to generate a YTX table that looks like below (pivot table with a static KeepDate dimension defining the cummulative end date of X across?).  The Fact table contains dimensions Product, Region, and Date with the fact data being Sales.

       

      ProductRegionAug 2011Sep 2011Oct 2011Nov 2011Dec 2011Jan 2012Feb 2012Mar 2012
      ANorth40045050055060070140210
      BNorth485460667271421
      CNorth72819099108102030
      AWest800900100011001200120240360

       

         I tried the following expressions but get a "-" value back.  Please help me understand where my problem in the expression is?  Thanks!

       

       

      =

      Sum({$
      <
      Date={"<=$(=KeepDate)"},
      Year = Year(Date),
      Quarter = ,
      Month =
      >
      }
      Sales)