Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
vkozlov
Partner - Creator
Partner - Creator

Set Analysis Doesn't work / Aggr in Sum

Hi all!

Today I faced a problem:

Set Analysis Doesn't work, when i use Aggr function in Sum function.

Example:

=Sum({<Year={2016}>} Aggr(Budget,Segment,Region, MonthYear))

(budget loaded only on 2016)

Looks like:

Without Year Selection - ok result "3618810433,6481" (dada loaded only on 2016)

Снимок.JPG

With selected Year=2016 - ok - result "3618810433,6481"

Снимок1.JPG

But if we select other Year (2015 for example)

Снимок3.JPG

We will get "0" as result.. It means, that our Set in function Sum({<Year={2016}>} Aggr(.. doesn't work. The result must be "3618810433,6481"

Help me somebody.. Why [Set Analysis Doesn't work / Aggr in Sum]?

1 Solution

Accepted Solutions
sunny_talwar

Try this:

=Sum({<Year={2016}>} Aggr(Only({<Year = {2016}>}Budget),Segment,Region, MonthYear))

View solution in original post

2 Replies
sunny_talwar

Try this:

=Sum({<Year={2016}>} Aggr(Only({<Year = {2016}>}Budget),Segment,Region, MonthYear))

Anonymous
Not applicable

Instead of Only, it might be better to use nested sum. That way Aggr will do a row reduction and improve expression performance