Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
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.

5 Replies
MK_QSL
MVP
MVP

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

Ralf-Narfeldt
Employee
Employee

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
Master III
Master III

Interval is a best option and function provided by Qlik.

hic
Former Employee
Former Employee

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

simonaubert
Partner - Specialist II
Partner - Specialist II

Hello,

Please note you can vote on this idea to implement datediff in Qlik Sense :
https://community.qlik.com/t5/Ideas/New-function-Datediff-to-have-the-difference-between-two-dates/i...

Best regards,

Simon

Bi Consultant (Dataviz & Dataprep) @ Business & Decision