Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

End Date - Start Date

HI All

I have 2 dates

Start date and End date

I want to create the following sum in script

End Date - Start date = eg...20

Any ideas?

Thanks

2 Replies
swuehl
MVP
MVP

If your dates are intepreted as such, they will hold a numeric representation.

(See: Data Types in QlikView)

You just need to set the date / timestamp format correctly in the script or use Date#() / Timestamp#() functions.

Then the calculation shoud work

SET DateFormat = 'MM/DD/YYYY'; //use your date format here

LOAD

     EndDate,

     StartDate,

     Interval( EndDate-StartDate ) as Duration

FROM ...;

See also

Why don’t my dates work?

MK_QSL
MVP
MVP

You can simply do... Date2-Date1