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

Announcements
Q&A with Qlik - Qlik Cloud Migration: Questions about migrating to Qlik Cloud? Catch the latest replay!
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
MVP
MVP

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
MVP
MVP

not entirely sure I understand the issue still