Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

abhaytrip
New Contributor III

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

Re: Difference between two dates

Try this?

TimeStamp(Field1, 'MMM D YYYY hh:mmTT') - TimeStamp(Field2, 'MMM D YYYY hh:mmTT')

abhaytrip
New Contributor III

Re: Difference between two dates

Hey ,

I tried this but it isn't working at all. shows no values.

Re: Difference between two dates

Did you try Interval function.

abhaytrip
New Contributor III

Re: Difference between two dates

Yes I did , But I couldn't fetch any results.

psilva001
Contributor

Re: Difference between two dates

interval(Col1 - Col2, 'DD hh:mm ')

abhaytrip
New Contributor III

Re: Difference between two dates

Tried that as well , :/

date1.PNG

Re: Difference between two dates

If those are names of fields with multiple values, better create a straight table with a separate row for each value combination for real_survey_date_sent and date_survey_received, and add an expression with one of the suggestions posted before.

Specifying a field name in a text box will return all values at once. And subtracting all values from all values will lead to a NULL result.

abhaytrip
New Contributor III

Re: Difference between two dates

date2.PNG

Tried this , but No values are shown.

Re: Difference between two dates

Can you share image simply using

Date1 - Date2 ??

Community Browser