Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to Aggregate in a Set Analysis

I am working on a app which analyses Spend.

Refer the sample table below

The logic in the "Spend" Column the checks if we have a value in the "IR" column if not it reports the value in "GR" column.

I created a variable Spend with the below logic.

IF((IR=0),GR,IR)

Now this logic works well in a table as seen below.

But I have not been able to use the logic in a KPI chart in a set analysis for total Spend for Current year.

Can some one please provide suggestions as to what is the best function to use. I wasn't able to get Aggregate function to work

POGRIR Spend Year
9990/00190$630.00$630.00$630.002018
1724/00110$10,500.00$17,500.00$17,500.00

2018

7407/00010$12,045.60$12,045.60$12,045.602018
1336/00030$212.00$212.00$212.002018
1336/00020$552.00$552.00$552.002017
1336/00010$3,576.00$3,576.00$3,576.002017
1339/00030$265.00$0.00$265.002017
1339/00020$302.00$0.00$302.002017
1339/00010$335.00$0.00$335.002017
1 Reply
brunobertels
Master
Master

Hi may be this

Sum(Aggr(

          if(IR=0,sum(GR),Sum(IR),Year))