Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

DATEDIFF

I am new to QuikSense and just starting to evaluate it as a BI tool.  I downloaded the free version and am trying to do a simple calculation with DATEDIFF, but get a "not a valid function" error when I attempt to upload the data. I am a SQL novice so there may be an error in my script (below). How in depth a knowledge of SQL does a user need have to develop useful, relevant apps? Where can I find a resource for functions built-in to QlikSense?

DATEDIFF(DD,admit_dt_ts, GETDATE()) as [LOS],

Thanks.

4 Replies
MVP
MVP

Re: DATEDIFF

Interval(now() - admit_dt_ts,'DD') as LOS

Employee
Employee

Re: DATEDIFF

DateDiff() is not a valid Qlik Sense function. Manish example should achieve the same.

Here's a link to the reference for Qlik Sense functions:

http://help.qlik.com/sense/en-US/online/#../Subsystems/Hub/Content/Scripting/FunctionsInScriptAndCha...

sujeetsingh
Honored Contributor III

Re: DATEDIFF

Interval is a best option and function provided by Qlik.

Employee
Employee

Re: DATEDIFF

Or simpler,

     now() - admit_dt_ts as LOS

Interval() just formats the result into a specified time format. Here you don't need it, since you want it in days and that is what the subtraction returns.

HIC

Community Browser