Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I've been trying to adapt an existing Qlik App to use a more even representation of equal quartile groups, instead of Fractile which is troublesome IF you happen to have a large portion with the same values.
I took the advice offered here - How to distribute values into quartiles evently? - Qlik Community - 1344684
But have still struggled to get it to work properly.
In our app we are using Fractile like this (4 variables);
=FraCTile({<EXCLUSION_REASON = {'Include'}, HOURLY_TOTAL_PAY = {">0"}>}HOURLY_TOTAL_PAY, 0.25)
And then using this in set analysis in a few diff ways like this;
Num(Avg({<HOURLY_TOTAL_PAY ={">0<=$(=vQuatile1)"}, EXCLUSION_REASON = {'Include'}>}HOURLY_TOTAL_PAY), '###,###.##')
I can get the rank logic to work as a variable/column in a table, but can't get it to work in the set analysis (of which there are many), I'm assuming because of the order calculations are completed?
This works perfectly as the column from a variable.
if(ceil(rank(total only({<EXCLUSION_REASON = {'Include'}, HOURLY_TOTAL_PAY = {">0"}>}HOURLY_TOTAL_PAY))
/ (count(total {<EXCLUSION_REASON = {'Include'}, HOURLY_TOTAL_PAY = {">0"}>}HOURLY_TOTAL_PAY) / 4)) = 4, '1',
if(ceil(rank(total only({<EXCLUSION_REASON = {'Include'}, HOURLY_TOTAL_PAY = {">0"}>}HOURLY_TOTAL_PAY))
/ (count(total {<EXCLUSION_REASON = {'Include'}, HOURLY_TOTAL_PAY = {">0"}>}HOURLY_TOTAL_PAY) / 4)) = 3, '2',
if(ceil(rank(total only({<EXCLUSION_REASON = {'Include'}, HOURLY_TOTAL_PAY = {">0"}>}HOURLY_TOTAL_PAY))
/ (count(total {<EXCLUSION_REASON = {'Include'}, HOURLY_TOTAL_PAY = {">0"}>}HOURLY_TOTAL_PAY) / 4)) = 2, '3',
if(ceil(rank(total only({<EXCLUSION_REASON = {'Include'}, HOURLY_TOTAL_PAY = {">0"}>}HOURLY_TOTAL_PAY))
/ (count(total {<EXCLUSION_REASON = {'Include'}, HOURLY_TOTAL_PAY = {">0"}>}HOURLY_TOTAL_PAY) / 4)) = 1, '4',
'5'))))
Finally, bonus points if there's a way we can evenly split things across Male/Female - using these rules (appreciate this might not be possible, or difficult at best);
"If there are a number of employees on the exact same hourly rate of pay crossing between two of the quartiles, make sure that the males and females are split as evenly as possible across the quartiles. For e.g. 40 staff all have the same hourly rate of pay. 36 are female and 4 are male. Of them, 10 have fallen into the lower quartile, while 30 have fallen into the lower middle quartile. To evenly distribute these staff by gender the employer can see that this means for every 9 females listed, 1 male should be listed with them"
Thanks
Tom
Hi! Still wondering if anyone can help with this 🙂