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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
adandreti
Contributor II
Contributor II

Count Late Jobs over Time Horizon

I am looking to create a line chart that visualizes all Jobs within a time horizon that are/were late while considering the multiple days they were late for. This breaks into two groups: jobs that were late and our now completed and jobs that are late and are yet to be completed. My aggregated data looks something like the following:

Consider Today=3/13/2020

JobkeyStartDateDueDateCompletionDateFlag (1=late)
64623/06/2020 3:50.43/13/2020-0
24903/05/2020 5:50.13/12/2020-1
35193/03/2020 13:503/11/20203/13/20201

 

so in a line chart I would want the above data would look like the following but am not having any luck.

Time DimensionCount of Late Jobs
3/11/20200
3/12/20201
3/13/20202
3/14/20201

 

My fields are being calculated as follows:

  1. StartDate: aggr(min(TimeKey),JobKey)
  2. DueDate: lastworkdate(aggr(min(TimeKey),JobKey),6)+1
  3. Completion Date: aggr( max({<From={ready_to_ship},To={complete}>}TimeKey),JobKey)
  4. late flag:  

    sum(

    //if condition for not complete jobs

    if( Match(To,'ready_to_print','printing','ready_to_sheet','sheeting','ready_to_bind','binding') and MostRecentStatusFlag=1
    and today()>lastworkdate(aggr( min(TimeKey),JobKey),6)
    ,1,

    //If condition for complete jobs

    if( Match(To,'complete') and Match(From,'ready_to_ship') and MostRecentStatusFlag=1
    and aggr( max(TimeKey),JobKey)>lastworkdate(aggr( min(TimeKey),JobKey),6)
    ,1,0))

    )

So the issue I am having is that I am able to identify a late job rather painlessly but I am not able to count that job it is late over the amount of days it is late for on a time dimension. My timekey for the jobs only come in when an event happens but I do have a master Time Calendar that I have been using to try and make this work.

 

Any suggestions are appreciated.

 

 

 

Labels (1)
0 Replies