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

Announcements
Talend Cloud AWS EU Scheduled Outage: Starting Tues 26 May 21:00 CEST with expected completion Wed 27 May 01:00 CEST
cancel
Showing results for 
Search instead for 
Did you mean: 
bartwelvaarts
Contributor III
Contributor III

Substract 2 times in set analysis

Hi,

 

I want to substract 2 times within set analysis. I calculated 2 times:
Only({<Status= {'START'}>}Time) 

Only({<Status= {'Completed'}>}Time) 

But Only({<Status= {'Completed'}>}Time)  - Only({<Status= {'START'}>}Time)  does not work.

I hope somebody can help me

Labels (1)
1 Solution

Accepted Solutions
tresB
Champion III
Champion III

@bartwelvaarts , your time field values are possible texts. Try to parse these values like:

Time(Only({<Status= {'Completed'}>} Time#(Time, 'hh:mm:ss')) - Only({<Status= {'START'}>} Time#(Time,'hh:mm:ss')))

View solution in original post

5 Replies
tresB
Champion III
Champion III

'does not work' - is a very limited information. Try to share more information on it, like: how  your output look like with that expression and how you expect it to be, how your data look like, etc.

PrashantSangle

What is the output you are getting??

 

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 🙂
bartwelvaarts
Contributor III
Contributor III
Author

This is my flat data

bartwelvaarts_14-1600071616223.png

I use : Only({<Status= {'START'}>}Time) & Only({<Status= {'Completed'}>}Time) to get the records on the same row, like the image below.

 

bartwelvaarts_12-1600071583621.png

 

Next, I want to calculate the time between Completed & START. 

I tried :

Only({<Status= {'Completed'}>}Time) - Only({<Status= {'START'}>}Time)

And als tried:

column(2)- column(1)

But both statements result in a NULL value

tresB
Champion III
Champion III

@bartwelvaarts , your time field values are possible texts. Try to parse these values like:

Time(Only({<Status= {'Completed'}>} Time#(Time, 'hh:mm:ss')) - Only({<Status= {'START'}>} Time#(Time,'hh:mm:ss')))

bartwelvaarts
Contributor III
Contributor III
Author

Worked perfectly! thank you very much!