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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Weird things when using Aggr in Chart expression

Hi,

The best way to show what's happening here is in the attached .qvw.

I load the following data (in two inline-s):

Datedecisioncountcustseverity
1good1A0.64
1bad3B0.22
2bad2C0.12
2good2A0.38
2good9B0.09
3bad9C0.42
3good3A0.85
4good10C0.25
4bad10A0.21
4bad3C0.17
5bad3C0.7
5good10A0.81
5good10B0.95
6bad0A

0.55

And plot a chart, where Date is the dimension and the expression is:

=sum(aggr(

sum(if(decision='good',count)) * sqrt(sum(severity))

,custId))

The expression is so it must use the aggr expression in order to calculate correctly.

Now, as can be seen in the qvw, the chart is really wired (some dates are missing...):

Capture.PNG.png

what causes this behavior?

How can I deal with it?

Thanks!

1 Solution

Accepted Solutions
rubenmarin1

Hi Amalin, if you do aggr only by custID, it keeps only these two dates because in next dates doesn't appears any new cust, you can try with:

=sum(aggr(

sum(if(decision='good',count)) * sqrt(sum(severity))

,Date,custId))

Check attachment and look if that's what you want.

View solution in original post

2 Replies
MK_QSL
MVP
MVP

Go to presentation tab and untick Suppress Zero Values

rubenmarin1

Hi Amalin, if you do aggr only by custID, it keeps only these two dates because in next dates doesn't appears any new cust, you can try with:

=sum(aggr(

sum(if(decision='good',count)) * sqrt(sum(severity))

,Date,custId))

Check attachment and look if that's what you want.