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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
abhaytrip
Creator
Creator

Difference between two dates

date.PNG

I WANT TO SHOW THE DIFFERENCE BETWEEN THE TWO DATES (The FIRST Col - The SECOND Col) and plot their values on a bar chart.
How can that be done ?
Thanks

15 Replies
abhaytrip
Creator
Creator
Author

here you go !date3.PNG

Anil_Babu_Samineni

Try this?

Interval( (date(timestamp#(Field1,'MMM D YYYY hh:mmTT'),'DD/MM/YYYY')) -   (date(timestamp#(Field2,'MMM D YYYY hh:mmTT'),'DD/MM/YYYY')), 'd')

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
abhaytrip
Creator
Creator
Author

date4.PNG

I'm getting the values in Integer.

After Formatting , I get this.


date5.PNG

But the diff in days isn't seen here 😕

Anil_Babu_Samineni

Try to change format only DD not DD:MM:YYYY

Another way

Date((date(timestamp#(Field1,'MMM D YYYY hh:mmTT'),'DD/MM/YYYY')) -   (date(timestamp#(Field2,'MMM D YYYY hh:mmTT'),'DD/MM/YYYY')), 'DD')

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
abhaytrip
Creator
Creator
Author

date6.PNG

Got this using DD hh:mmTT ,Thanks Folks !

Anil_Babu_Samineni

Great Qlik Community Tip: Marking Replies as Correct or Helpful

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