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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
markmccoid
Partner - Creator II
Partner - Creator II

AGGR Odd Behavior?

Hi,

First, what I'm trying to accomplish is to take the Monthly Profit (Profit) for a Customer and use it to count how many customers where UNProfitable that month.

SUM(IF(AGGR(SUM(Profit),Month, Customer) < 0,1,0))

This works fine when the chart has Month in its dimensions, but when I collapse to Year, it will return the number of months a customer was UNprofitable.

So I thought I would just create a chart without months and use this expression:

SUM(IF(AGGR(SUM(Profit), Customer) < 0,1,0))

Works fine except I noticed that when I leave the month in the dimensions, the result for each month/subscriber is different. I would have through that it would be the same since the aggregation is over the customer.

error loading image

Any thoughts on how I could get one expression to work for both the expanded and collapsed states and/or why the above behavior is happening with AGGR?

Thanks,

Mark

Labels (1)
2 Replies
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

could you post an example?

Ask me about Qlik Sense Expert Class!
markmccoid
Partner - Creator II
Partner - Creator II
Author

Sure. Attached is an example QVW with data for just one subscriber.

Thanks