4 Replies Latest reply: May 25, 2012 9:10 AM by JULIAN Rodriguez RSS

    Comparative Columns with a Pivot Table

    JULIAN Rodriguez

      Hello there, I'm new with QV and Set Analysis

       

      I have a Pivot table with months (YearMonth) as Dimension and one Count (Files) as Expression. I need a new colum (expression) with the comparative value between the month and the last month,

       

      I'm using set analisys but I don't know what the problem is... this is the code for the second column:

       

      COUNT({<YearMonth={"MONTH(AddMonths(YearMonth, -1))"}>} Files)

       

      What is the problem with that?...

       

      Thanks for your help !

        • Comparative Columns with a Pivot Table
          Michael Solomovich

          Julian,

           

          The first problem is the syntax:
          COUNT({<YearMonth={"$(=MONTH(AddMonths(YearMonth, -1)))"}>} Files)
          The second problem is the data format.  Make sure that expression
          =MONTH(AddMonths(YearMonth, -1))
          returns data in the same format as YearMonth field.  I suspect that YearMonth includes both month and year, while the expression returns only month.  Maybe this is closer to what you need, assuming YearMonth format is YYYY-MMM:
          =date(AddMonths(YearMonth, -1),'YYYY-MMM')

          (I'm not sure if these are the only problems, just a quick look...)

           

          Regards,
          Michael