Jump to content

Robert Hood
Go to solution Solved by Robert Hood,

Recommended Posts

Hi all, I have a cross table that displays different product columns with a running total by month for budget dollars and actual spend dollars. I can't seem to get the table to subtract the budget from actuals with  a running total by month. I'd like to end up with a differnce line for each month and product. 

Sum([Budget]) THEN Sum([Value]) OVER (AllPrevious([Axis.Columns])) - Sum([Actuals]) THEN Sum([Value]) OVER (AllPrevious([Axis.Columns])) AS Difference

image.png.3c192a42687e1dbc213ed6d75ac61166.png

Link to comment
Share on other sites

Hi Robert, Yes indeed, when using the THEN you should first perform the aggregation and any other calculations and use the [value] after the THEN statement. This is very useful when working with in-data sources since it will optimize the query sent to underlying databases.

Since the [budget] and [actuals] are calculated on the same axes AllPrevious([Axis.Columns]), using the second expression is easier and more effective. 

In some other situations, this can require more complex expressions 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...