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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
t_guet01
Contributor II
Contributor II

How to hard code an ABC analysis in script?

Hey guys,

I am following the https://community.qlik.com/t5/Qlik-Design-Blog/Recipe-for-an-ABC-Analysis/ba-p/1472867 to perform an ABC analysis in work sheet mode. However, I would like to hard code an ABC-dimension in my data for customers.

I tried the following: creating a mapping table with CustomerID and the ABC dimension, based on the sales table. Code-wise it looks like this (I used the ABC code provided by Henric in the original post):

MappingABC:
Mapping Load
CustomerID,
Aggr( If((Rank(Sum(Net),1)-1) / Count(distinct total CustomerID)< 0.50, 'A',If((Rank(Sum(Net),1)-1) / Count(distinct total CustomerID)< 0.75, 'B', 'C')),CustomerID)
Resident Sales
Where year(Date)=2021 group by CustomerID;

However, Aggr & Rank do not work in the script, besides I didn't give any sorting order.

Does anyone know how this would work? I've only found dynamic topics in the forum, not this static option.

Thanks and best

T

Labels (1)
0 Replies