Skip to main content
Announcements
Join us on Feb.12 to Discover what’s possible with embedded analytics: REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
ZimaBlue
Creator
Creator

Ignoring fields in sum aggr does not work (chart)

Hello!

I'm just trying to do a very simple thing: I need to count the sum of the values so that the filter for some fields is ignored. At the same time, I use aggregation of the sum across several fields.

However, qlik sense ignores this condition and in any case the amount changes when there are fields in the filter that are not specified in the formula.

Data sample:

partner campaign adGroup keyword spent_eur
p1 c1 ad1 keyword1 15
p1 c2 ad2 keyword2 3
p3 c3 ad3 keyword3 5
p2 c4 ad4 keyword2 10

 

Let's assume I'm filtering p1 and keyword2. What qlik sense should show me: 18 (15+3) -> (I want to ignore the keyword filter)

What is it really showing me: 3

The formula I use (one of the many options I've tried):

SUM(AGGR(SUM({1 <partner=P(partner_name), campaign=P(campaign), adGroup=P(adGroup), m_date= {">=$(vDateFrom)<=$(vDateTo)"}, keyword=>} spent_eur),
partner, campaign, adGroup, m_date))

I also tried adding total before distinct or after it, but then the value even without the filter becomes incorrect, it's some random incorrect number.

Thanks for any tips

 

Labels (1)
1 Solution

Accepted Solutions
vinieme12
Champion III
Champion III

Try below

SUM({<keyword=>} AGGR(SUM({<keyword=,- m_date= {">=$(vDateFrom)<=$(vDateTo)"}>} spent_eur),
partner, campaign, adGroup, m_date))

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.

View solution in original post

4 Replies
vinieme12
Champion III
Champion III

to ignore a filter in a particular field just leave the right side of equal sign empty, aggr() is not needed

 

SUM({<keyword=,m_date= {">=$(vDateFrom)<=$(vDateTo)"}>} spent_eur)

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
ZimaBlue
Creator
Creator
Author

I use aggr for other purposes, unfortunately I can't give it up.

vinieme12
Champion III
Champion III

Try below

SUM({<keyword=>} AGGR(SUM({<keyword=,- m_date= {">=$(vDateFrom)<=$(vDateTo)"}>} spent_eur),
partner, campaign, adGroup, m_date))

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
ZimaBlue
Creator
Creator
Author

It looks like it's working brilliantly! Thank you!