Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
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

2 Replies
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

markmccoid
Partner - Creator II
Partner - Creator II
Author

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

Thanks