Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
vkozlov
Contributor

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]?

Tags (1)
1 Solution

Accepted Solutions

Re: Set Analysis Doesn't work / Aggr in Sum

Try this:

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

2 Replies

Re: Set Analysis Doesn't work / Aggr in Sum

Try this:

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

sksingh3286
New Contributor II

Re: Set Analysis Doesn't work / Aggr in Sum

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