Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

how to find years

Hi All,

Suppose i have one date like '01-06-2001' and another date is '01-06-2015' I want to find that years between to date in qlikview.

How to achieve that.

Thanks

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi Jagan,

you solution is write I tried with below

=fabs(Age(Date#('01-06-2001','DD-MM-YYYY'),Date#('01-06-2015','DD-MM-YYYY')))

View solution in original post

7 Replies
anbu1984
Master III
Master III

=Year(Date#('01-06-2015','MM-DD-YYYY')) - Year(Date#('01-06-2011','MM-DD-YYYY') )

Anonymous
Not applicable
Author

Hi anbu,

I want year count.

eg. Suppose i bought one car on 01-06-2011 and still i am using that car so i want to know i many years i used that car.

Thanks

tresesco
MVP
MVP

Try age() for finding number of years, or interval() for more details - xx years xx months xx days

=Age(today(), '01-06-2011 ')    -- gives 3  (i.e. 3 years)

Anonymous
Not applicable
Author

Hi Tresesco,

I tried but output is not coming.

jagan
Luminary Alumni
Luminary Alumni

Hi,

Try like this

=Age(Date1, Date2)

OR Ceil(Interval(Date1 - Date2)/365)

OR Ceil((Date1 - Date2)/365)


In place of Ceil() you can also try Round() .

Regards,

Jagan.

tresesco
MVP
MVP

That could beacuse of improper date format. check your default date format in the app and try with that. Else can try like this too:

Age(today(), Date#('01-06-2011 ', 'DD-MM-YYYY'))

Anonymous
Not applicable
Author

Hi Jagan,

you solution is write I tried with below

=fabs(Age(Date#('01-06-2001','DD-MM-YYYY'),Date#('01-06-2015','DD-MM-YYYY')))