Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Wiktor
Contributor
Contributor

Greater then average sales by client and town

Hello

I have to calculate avg sales per client in every town, in every month.  Then for every town mark clients with higher sales than average. I have little experience with "IF" and  I don't now how to make link client sales with town average.
I tried this:
IF((sum(Sales))>(Aggr((Sum([Sales])),[Town],[date.autoCalendar.YearMonth])/Count ( distinct [Client])),1,0)

3 Replies
sunny_talwar

Would you be able to share some data and the output you expect to see from the data shared?

Wiktor
Contributor
Contributor
Author

clipboard_image_0.png

Is screenshot enough?

On the left - bolded is town, clients are below.   M_* is sales per client, Avg sales is for town.
Ideally for me will be situation when for every client I get Avg Sales identical as it is for Town. I don't know why sometimes there is value, but it is wrong.

sunny_talwar

not entirely sure I understand the issue still