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: 
qliktech_uk
Contributor III
Contributor III

Date part missing.

Hi

I have a field taken from a spreadsheet that has a timestamp however for few records it just has the time. How do I populate the missing date? WHen I calculate the interval I get the wrong figures as its subtracting  time (epoch date I assume)  from the timestamp.

eg: 11:30:00  - 23/10/2017 11:10:10

Your help is appreciated.

Labels (1)
6 Replies
Anil_Babu_Samineni
MVP
MVP

What are you expecting from above timestamp?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
qliktech_uk
Contributor III
Contributor III
Author

I just need to get the time difference. I tried stripping off the date part but wasnt successfull.

eg: 11:30:00  - 23/10/2017 11:10:10

So the above example should give me 20.

qliktech_uk
Contributor III
Contributor III
Author

Can I use the function right and get the time part?

Anil_Babu_Samineni
MVP
MVP

May be this?

=Interval(Frac(Date(Date#('FieldName1,'hh:mm:ss'),'mm') - Date(Date#(FieldName2, 'DD/MM/YYYY hh:mm:ss'),'mm')),'mm')

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
tresB
Champion III
Champion III

If the fields are already timestamps, you could simply try like:


Interval(Field1-Frac(Field2), 'm')


If the fields are string, convert them using parsing functions like date#(), timestamp#().. and then apply the same logic

its_anandrjs
Champion III
Champion III

Then why not remove dates from the rows also and do interval match for the hh:mm:ss

Interval( Field1  -  TimeStamp(TimeStamp#(Right(Field2,8),'hh:mm:ss'),'hh:mm:ss') , 'mm')