Forum Discussion

danblack's avatar
danblack
Cloud Apps
04-15-2024
Solved

Adding difference columns to pivot tables

I simply have a pivot table where the first column contains a varchar and the last column contains grand totals.  All columns in between are monthly totals.  I would like to add columns in between th...
  • TriAnthony's avatar
    TriAnthony
    04-17-2024

    Hi danblack,

    You can use the next() function for this. Here's an example formula:

     

    (
      <your aggregation formula> + 
      CASE WHEN ISNULL((<your aggregation formula>, NEXT([Months in <your date field>], 1))) THEN <your aggregation formula>
           ELSE (<your aggregation formula>, NEXT([Months in <your date field>], 1))
      END
    )
    / 2

     

    This formula assumes for the last month, since there is no more column to the right, the averages would be the same values as that month's column.

    Here's a how the results look like with Sample ECommerce data:

    -Tri