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: 
Jacklin24
Contributor II
Contributor II

Aggr Issue

I want to plot a line graph showing how long each job duration takes to run successfully. X axis has dates. Y axis will have duration when job_status is 'Completed'. A job runs parallaly multiple times. I need to perform an aggr operation on job_id and fetch the min of start_time and max of end_time and obtain the difference to get the correct interval. Help form expression. 

job_id start end status
1 10 Jan 2024 8:25 AM 10 Jan 2024 8:35 AM Completed
1 10 Jan 2024 8:32 AM 10 Jan 2024 8:38 AM Completed
1 10 Jan 2024 8:34 AM 10 Jan 2024 8:45 AM Completed
1 10 Jan 2024 8:39 AM 10 Jan 2024 8:50 AM Completed
2 10 Jan 9:am 10 Jan 2024 9:10 AM Completed
2 10 Jan 2024 9:05 AM 10 Jan 2024 9:20 AM Completed

By this table, job i ran for 25 minutes and job 2 ran for 20 minutes. 

Labels (3)
1 Reply
Sayed_Mannan
Creator II
Creator II

try this,

Aggr(
Interval(
Max({<status={'Completed'}>} Timestamp(end)) - Min({<status={'Completed'}>} Timestamp(start)),
'mm'
),
job_id
)