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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
sogloqlik
Creator III
Creator III

Count Number of Months With Sales above average per customer

Hi.

I have the following requirement:

For every customer, I Have to count the number of months with sales above average.

The average is calculated for the sales of max year selected (Meaning if no year is selected it is 2021,) divided by the number of months selected (Jan-May = 5).

the count itself must conclude all the years.

See file with example.

 

The only thing which is different from the example is that sales is a very complicated expression hence it is implemented in a variable - $(Sales). I Can't touch it.

 

Regards,

Motty.

11 Replies
eddie_wagt
Partner - Creator III
Partner - Creator III

You are welcome. Wish you the best. 

sogloqlik
Creator III
Creator III
Author

This is the Expression that eventually gave the desired results:

 

Sum(Aggr(If(Sum(Total <[Customer]>aggr({<Year={$(=Max(Year))}>} $(vSales)
, Customer))
/ GetSelectedCount(Month) < $(vSales), 1, 0), [Customer], Year, Month))

 

Thanks for all of you who tried to help