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

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Compare time difference

Hi,

I have this expression that I use to calculate time difference in hours and minutes -

=(interval(aggr(max(modified_end_time), process_id) - aggr(max(actual_start_time), process_id)))

I get the correct answer for hours and mins. Now I want to build a chart to show where this interval is greater than 2 hours, 4 hours etc.

How do I compare interval?

Thanks

1 Solution

Accepted Solutions
hic
Former Employee
Former Employee

I would approach this problem in a different way.

  1. Create a chart with process_id as dimension
  2. Use interval(max(modified_end_time) - max(actual_start_time))
  3. Sort by y-value

Then you will get a direct overview over the statuses of the processes, without having to define the 2 or 4 hour thresholds.

If you then in a second step want to create a chart with these intervals as a dimension, e.g. to see the number of processes within each class, you can do this with the aggr function. I would probably then use

   class(aggr(...) /24, 1)

as dimension.

HIC

View solution in original post

2 Replies
shree909
Partner - Specialist II
Partner - Specialist II

Hi, this can be done by using if statement  if((interval(aggr(max(modified_end_time), process_id) - aggr(max(actual_start_time), process_id))))  >2  ..

some thing like that.. so what u want to show exactly if it is greater than 2 and greater than 4, do u want to show it as different  color  or something else.............

hic
Former Employee
Former Employee

I would approach this problem in a different way.

  1. Create a chart with process_id as dimension
  2. Use interval(max(modified_end_time) - max(actual_start_time))
  3. Sort by y-value

Then you will get a direct overview over the statuses of the processes, without having to define the 2 or 4 hour thresholds.

If you then in a second step want to create a chart with these intervals as a dimension, e.g. to see the number of processes within each class, you can do this with the aggr function. I would probably then use

   class(aggr(...) /24, 1)

as dimension.

HIC