Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Datediff in Qlikview

Hi,

Is there any way to find the datediff in QlikView or any relevant functions in Qlikview?????.

Regards,

XXX

9 Replies
suniljain
Master
Master

Dear

Date(Date1)-Date(Date2) as Date_Diff

You can use this logic at script level as well as in sheet object.

Regards

Sunil

Not applicable
Author

Thanks Sunil.

Let me check and update on how it works.................

Not applicable
Author

write this micro in macro editor

function datediff3(d1,d2)
datediff3=datediff("D",Date1,Date2)
end function



then call this macro in script

As datediff2(Date1,Date2)

Regards

Ashish Srivastava

Not applicable
Author

Thanks Ashish ..

My requirement is to find the age (Currentdate- Datefeild) at the Object level and count of that specific Age.

I am using the now () fucntion currently. Is there any other function to get the System current date

Regards,

XXX

Not applicable
Author

Hi

Age() function is there in qlikview please use this finding the age.

Regards

Ashish Srivastava

Not applicable
Author

Thanks Ashish,

Age will give you the result in terms of years . I am looking in terms of Days. is there any other option for the same?

Regards,

XXX

Not applicable
Author

Use this macro

function datediff3(d1,d2)
datediff3=datediff("D",Date1,Date2)
end function



then call this macro in script

datediff3(today(),[persion birth date])

this way you find the number of day.

Regards

Ashish

brenner_martina
Partner - Specialist II
Partner - Specialist II

Hi,

there a lot of datefunctions, for a difference you can use the following

Num(Year(Date1)) - Num(Year(Date2)) --> gives the yeardiff
Num(Month(Date1)) - Num(Month(Date2)) --> gives the wonthdiff
Num(Week(Date1)) - Num(Week(Date2)) --> gives the weekdiff
Num(Date1) - Num(Date2)) --> gives the daydiff

and so on!

Not applicable
Author

ya i know but the help of datediff you get integer value.

Regards

Ashish Srivastava