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

Formula with Sum(Agg(Sum(DISTINC...

Hi everyone.

I have the following question.

The following formula (of a graph) works and, when I make some selection in the Dashboard, it filters correctly.

SUM({1<[Date]={">=$(=YearStart(min(Date))) <=$(=YearEnd(max(Date)))" }>}[amount_1])

But, the next formula I need to apply for a metric (of a graph) with aggr and distinc, does not filter correctly. If I make a selection, the formula does not filter according to that selection. The formula is this:

SUM(aggr(SUM(DISTINCT {1<[Date]={">=$(=YearStart(min(Date))) <=$(=YearEnd(max(Date)))" }>}amount_2), id_center))

How should this second formula be expressed correctly so that it filters?

Thank you very much.
Greetings.

Labels (4)
1 Reply
chrismarlow
Specialist II
Specialist II

Hi,

There is some detail on the blog here;

Set Analysis in the Aggr function - Qlik Community - 1463822

This suggests putting set on both aggregations (so both SUM statements), with caveats on testing & how to work out if inner/outer/both is actually the right thing to do.

Cheers,

Chris.