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: 
krmvacar
Creator II
Creator II

Qliksense Time Calculation

Hi All,

Example:

Name       Workstart                       Workend                   Time Work(Minutes)
John         01.12.2021 08:26     01.12.2021 09:58      92 minutes
                    01.12.2021 08:45     01.12.2021 10:06        8 minutes

As you can see in the example above, since the second start time is within the first end time, I need to accept the first end time as the start and calculate the difference with the second end time.

How can I do this with calculation method in expression ?

Your help is requested.

Labels (2)
1 Solution

Accepted Solutions
PrashantSangle

Hi, 

Used below expression 

if(Interval(Workend - Timestamp(RangeMax(Above(total Workend,0,3))))<0,0,
Interval(Workend - if(Workstart<Above(Total Workend),Above(Total Workend),Workstart),'mm'))

 

Regards,

Prashant Sangle

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂

View solution in original post

5 Replies
vinieme12
Champion III
Champion III

Try below

Dimension = Name

Measure=Interval(min(Workstart) - max(WorkEnd),'mm' )

 

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
krmvacar
Creator II
Creator II
Author

Hi , @vinieme12  ,

ı try but its not working.

ıts must be total 519 mınutes.

I want to show  example.JPG  show.

Thanks

 

PrashantSangle

Hi, 

Used below expression 

if(Interval(Workend - Timestamp(RangeMax(Above(total Workend,0,3))))<0,0,
Interval(Workend - if(Workstart<Above(Total Workend),Above(Total Workend),Workstart),'mm'))

 

Regards,

Prashant Sangle

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
PrashantSangle

if you want the total also then use below expression

Num(Num#(if(Interval(Workend - Timestamp(RangeMax(Above(total Workend,0,3))))<0,0,
Interval(Workend - if(Workstart<Above(Total Workend),Above(Total Workend),Workstart),'mm')),'###0'))

and formating tab > select sum

PrashantSangle_0-1648884936031.png

 

Regards,

Prashant Sangle

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
krmvacar
Creator II
Creator II
Author

Thank you so much