How to calculate number of months between two dates in QlikView?

qlikview

#1

Hi,

I want to calculate the age of employee at the end of the selected year (current selection). For example: if current selected year is 2007 then age must be calculated from DOB to 31-Dec-2007 and if more than one year is selected, it must take the end date of latest year.

Please help me to resolve this.

Regards,
Rahul


#2

Hey Rahul Thanks for posting this query. First we have to convert both the start date and end date to a number using date function. Then using datedif(start_date,end_date,“y”) you will get the output. Remeber if you want to get output as years then put y, if you want to get output as months then put “m” you will get the output.

Hope you got your answer

Thanks

Sourav Datta