Classification with QS

Hello, I am trying to do some ABC classification but I am blocked…

I have the “orderd units” as column I would like to use in my classification. So I created the rank_unit parameter as:

rank([sum({units ordered historical}) DESC])

and it works without problems. HOwever when I try to assign the A (the first 10%) B (from 10-20%) or C (20-100) level according to the rank values.
however, I do not find a good way to avoid the aggregation problems…in Python this calculation it is super easy, but here I am struggling.

ifelse({rank_unit} <= XXXX *0.1,'A', ifelse({rank_unit} < XXXX *0.2 AND {rank_unit} > XXXX *0.1,'B','C'))

If I find the right why to insert as XXX the max number of the dataset (which changes according to the data dispalyed) then everything will work.

However I tried so many different things like max(rank_unit), to calculate the lines and use that one, but I always occurs in the aggregation problem

I think it is quite an easy problem but I really do not know how to fix it

Hello,

I found a solution to this problem…I created a visual showing the total lines in the dataset.

then I created a parameters in the visual that the viewer can modify inserting the numbers displayed in that visual and I put this parameter where there is XXXX in the previous form.

It is not super convenient but it is a way to overcome the aggregation problems

1 Like