Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have two date fields in qlikview and i want to show the diff between dates of the respective values. Is there any datediff() function or any other function to find the diff. of two dates.
Thanks,
Rahul
Hi Rahul,
I assume this is a chart expression and not in the script.
Datediff is what you would use in SQL. With the SQL function you can specify whether you want Days/Months/Years/Hours.
In QV you could simply "Date1 - Date1" which will use the Julian date (39827 - 39934) and give you the number of days difference. To get years difference you have to you "year(Date1) - year(Date2)".
I hope this was helpful.
Regards,
Werner
hi rahul
solution given to you bywrenback is right
Himanshu
Thanks Maestro this works....
Thanks for ur time....
Hi, I'm trying to find a similar datedif function, I had got as far as using julian date diffs but its not effective,
i.e. if you take the last day of 2009, in Julian 109365 - the last day in 2008, 108365 then your answer would be 1000, and thats not the case, there aren't 1000 days between the last day of 08 and the last day of 09.
How can you do it? Even when I turn them into actual dates I can't take one from the other. Any ideas?
Are you sure that your 'dates' are being recognised as dates? For example , this little test script returns a value of 365 for 'diff' wher emy date format is dd/mm/yyyy
[t1]:
LOAD * INLINE [
F1, F2
31/12/2009, 31/12/2008
];
load *, F1 - F2 as diff resident t1;
Regards,
Gordon