Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Outstanding balance pivot table Set analysis

Hello,

I have daily account balances snapshots and using set analysis to calculate outstanding totals.

The formula sum ({<BalanceDate = {'$(=Max(BalanceDate))'} >} Balance) does work for the latest total but doesn't consider month/day dimensions

2015-07-16_17-38-45.png

Please advise

1 Solution

Accepted Solutions
Not applicable
Author

Following the advice I've modified the formula

     FirstSortedValue ( Aggr( Sum(Balance), BalanceDate) , -BalanceDate)

and it works in test example

2015-07-16_19-12-31.png

but it loosing calculation if extra dimension added, Company for example

View solution in original post

3 Replies
MK_QSL
MVP
MVP

In Set Analysis, Set Expression is evaluated before the aggregation made. So in this case, Max(BalanceDate) is calculated first which will remain same for all lines. You can't have Max(BalanceDate) for each line different using set analysis.

Not applicable
Author

Following the advice I've modified the formula

     FirstSortedValue ( Aggr( Sum(Balance), BalanceDate) , -BalanceDate)

and it works in test example

2015-07-16_19-12-31.png

but it loosing calculation if extra dimension added, Company for example

MK_QSL
MVP
MVP

Add company in Aggr