Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a sales model and I want to check the average purchase for each customer and sort them from highest to lowest. The dimension would be the customer's name and the metric would be total sales (Sum(LinePrice)) divided by the number of transactions (Count(distinct TranID)). That works fine.
The problem is that there are also customers who made one large transaction, and they stand out compared to the others. I want to add an option in the sheet for the user to select the minimum and maximum number of transactions. For example, let’s say the variable(s) will be set to 10 as the minimum and 20 as the maximum. In this case, the object will display only the customers who made between 10 and 20 transactions.
This seems quite simple but I’m having trouble implementing it in the metric formula.
I would appreciate your help.
Thanks!
Hi Amit,
Please try the below formula and see if this will resolve the below issue.
Please find the attached sample data and qlikview file.
sum(if( Aggr(Count(Sales),Customer)>=2 and Aggr(Count(Sales),Customer)<=4, Sales))
/
Count(if( Aggr(Count(Sales),Customer)>=2 and Aggr(Count(Sales),Customer)<=4, Customer))