Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Pivot Table - Conditional Sum

Hi,

I am trying to produce a pivot table around dates and to sum data up until the dimension.

I have tried using a sum(if( statement but I cant get this to work.  The application works off two table (costs and accounts).  The costs are updated at regular intervals which formulate the date.

The result I am trying to acheive is below:

Year31/01/201228/02/201231/03/201230/04/2012
201115750164501645016450

Can anyone help?

Many thanks

1 Solution

Accepted Solutions
Gysbert_Wassenaar

You'll want to add a distinct since for every record in Accounts, you have four in Claims. Try:

Sum(distinct If( Transaction <= LoadDate , Amount, 0))


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar

You'll want to add a distinct since for every record in Accounts, you have four in Claims. Try:

Sum(distinct If( Transaction <= LoadDate , Amount, 0))


talk is cheap, supply exceeds demand
Not applicable
Author

That works; thanks for that.