2 Replies Latest reply: Jul 22, 2013 11:01 AM by aquilaquilz RSS

    Set Analysis Headache!

      Hi,

       

      I have a weird problem that has been troubling me for a few days now. My output is to show the current month’s totals to the previous months, as well as the current month from the previous year. If you see in the attached example, I have selected Dec 2012 from the YEAR and MONTH Listboxes. The values for the selected month show without any problems BUT I can’t see the previous month and current month previous year's totals.

       

      I’m using set analysis to get these values and control the months using variables (shown on the side of the table as well).

       

      This is how I get my values and the variables:

      Current Month: SUM({$<MonthDate={'$(vMonth)'}>} OperationalTrendTotal)

      Previous Month: SUM({$<MonthDate={'$(vPreviousMonth)'}>} OperationalTrendTotal)

      Current Month Previous Year: =SUM({$<MonthDate={'$(vPreviousYearCurrentMonth)'}>} OperationalTrendTotal)

       

      vMonth =Date(MonthDate, 'YYYY-MM-DD')

      vPreviousMonth =Date(AddMonths(MonthDate,-1), 'YYYY-MM-DD')

      vPreviousYearCurrentMonth =Date(AddMonths(MonthDate,-12), 'YYYY-MM-DD')