Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
s_gorgo
Contributor II
Contributor II

Dynamic On Time Delivery

Hello,

I'm going crazy 😀

I need to calculate the on time delivery KPI of the plant. Simple... on paper.

Sales OrderCodeRequested DateDelivery DateReq WkDelay
123Object12320/07/202020/07/202030FALSE
124Object12320/07/202021/07/202030TRUE
125ObjectABC17/07/202020/07/202029TRUE
126ObjectABC17/07/202015/07/202029FALSE
127Object12310/07/2020-28TRUE
128Object12310/07/202010/07/202028FALSE
129ObjectABC10/07/202015/07/202028TRUE

Each weeks I have the number of object that we have to deliver.

Incorrect KPI:

Req Wk# pcs requested# pcs on delay
2832
2921
3021

Why incorrect? Because I don't consider the delay of the previous week in the workload.

Correct KPI:

Req Wk# pcs requested# pcs on delay
2832
294 (2 wk29 + 2 delay wk28)2 (1 wk29 + 1 wk38)
3042 (1 wk30 + 1 wk28)

While the "incorrect" KPI is easy for me to calculate, I don't know where to start to calculate the most appropriate for me.

Has anyone had a similar experiences? Can you help me please?

Thank you!

Labels (3)
4 Replies
Kushal_Chawda

for # pcs on delay , Week 29,  1 delay is for 29 + how 1 is for week 28? Is it not 2 for week 28?

s_gorgo
Contributor II
Contributor II
Author

Hello Kush,

thanks for your reply. 😉

At the end of the week 29 we have 2 delays in this example:

  • S.O. 125 (requested date 17/7, not yet delivered)
  • S.O. 127 (requested date 10/7, not yet delivered) --> delay in wk28, delay in wk29

 

s_gorgo
Contributor II
Contributor II
Author

Up! 😊

Kushal_Chawda

try below

 

T1:
LOAD
    "Sales Order",
    Code,
    "Requested Date",
     if(len(trim("Delivery Date"))=0,1,0) as Not_Delivered_Flag1,
    Week("Requested Date") as Req_Week,
    "Delivery Date",
    Delay
FROM [lib://Web]
(html, utf8, embedded labels, table is @1);

T2:
Load Req_Week,
     Count("Sales Order") as Order_count
Resident T1
Group by Req_Week;

Left Join (T2)
Load  Req_Week,
     sum(Not_Delivered_Flag1) as Not_Delivered_cnt1
Resident T1
Group by Req_Week;

Drop Field Not_Delivered_Flag1;

Left Join (T2)
Load Req_Week,
     Count("Sales Order") as Delay_count
Resident T1
where lower(trim(Delay))='true'
Group by Req_Week;

T3:
Load Req_Week,
     Order_count,
     Not_Delivered_cnt1,
     Delay_count,
     if(Not_Delivered_cnt1>0,Not_Delivered_cnt1,rangesum(Peek(Not_Delivered_cnt),Not_Delivered_cnt1)) as Not_Delivered_cnt,
     if(RowNo()=1,Delay_count,rangesum(Delay_count,Peek(Not_Delivered_cnt))) as PC_Delay,
     if(RowNo()=1,Order_count, rangesum(Order_count,Peek(PC_Delay))) as PC_Requested
Resident T2
Order by Req_Week;

Drop Table T2;

Drop Fields Order_count,Not_Delivered_cnt1,Not_Delivered_cnt,Delay_count;

 

 

Annotation 2020-07-29 134517.png