Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Vern2022
Contributor III
Contributor III

Quartiles not working as expected. Qlik scripting

 

Vern2022_0-1680722162946.png

 

Can somebody please tell me why my Quartiles are not working correctly? If you look at the top table provided.

You will see the top quartile sometimes has a lower number than the middle quartile.

You will see from the bottom table provided that Q1, Q2 show as 0 where as Q3 contains a number. This is also true when I set them as dimensions oppose to measures.

your help is appreciated.

This is what is in the script:

[SalesFunnelEvents]:

LOAD EventDate, EmployeeNumber, aardate, AvailableSeconds, NetAvailableHours, NetAvailableSeconds, TotalCallsIn, TotalCallsOut, TotalTalkIn, TotalTalkOut, TransactionType, AccountNo, cdhtTransDate, if(isnull(DeliveryMargin), 0, DeliveryMargin) as DeliveryMargin, DeliverySalesValue, if(isnull(DeliveryVolume), 0,DeliveryVolume) as DeliveryVolume, oDateCreated, olRowid, OrderConvertedQuantity, OrderTotalMarginGBP, qDateCreated, qlRowid From [lib://.qvd](qvd); [SalesFunnelEventsNew]: join(SalesFunnelEvents) LOAD Fractile(DeliveryVolume, 0.25) as DeliveryVolumeQ1, Fractile(DeliveryVolume, 0.50) as DeliveryVolumeQ2, Fractile(DeliveryVolume, 0.75) as DeliveryVolumeQ3, Fractile(DeliveryMargin, 0.25) as DeliveryMarginQ1, Fractile(DeliveryMargin, 0.50) as DeliveryMarginQ2, Fractile(DeliveryMargin, 0.75) as DeliveryMarginQ3

resident SalesFunnelEvents; //In the back ground colour expression for the measure itself =if(Dimensionality() = 3 and (match([Month Offset], '0', '-1', '-2', '-3', '-12')) , if([Delivery Volume] <= sum([DeliveryVolumeQ1]), red(), if([Delivery Volume] < sum([DeliveryVolumeQ3]) and [Delivery Volume] > sum([DeliveryVolumeQ1]), blue(), if([Delivery Volume] >= sum([DeliveryVolumeQ3]), green())) ) )

Many thanks

Labels (5)
0 Replies