Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
BARC’s The BI Survey 19 makes it official. BI users love Qlik. GET REPORT
qv_testing
Valued Contributor II

Re: Re: Calculate Age in Qlikview

Hi Swuehl,

it's not open here, please give me text..

thanks

Highlighted
Not applicable

Re: Re: Calculate Age in Qlikview

*DT1 is DoB

*DT2 is Second Day (Today)

age(DT2,DT1)&' Years '&

  if(day(DT2) >= day(DT1),

  mod((Year(DT2)*12+Month(DT2))-(Year(DT1)*12+Month(DT1)),12),

  if(mod((Year(DT2)*12+Month(DT2))-(Year(DT1)*12+Month(DT1)),12)=0,11,mod((Year(DT2)*12+Month(DT2))-(Year(DT1)*12+Month(DT1)),12)-1)) &' Months '&

  if(day(DT2) >= day(DT1),

  day(DT2)-day(DT1),

  DT2-addmonths(DT1,12*(age(DT2,DT1))+if(mod((Year(DT2)*12+Month(DT2))-(Year(DT1)*12+Month(DT1)),12)=0,11,mod((Year(DT2)*12+Month(DT2))-(Year(DT1)*12+Month(DT1)),12)-1)))

nadeemsmarty
Valued Contributor

Re: Calculate Age in Qlikview

Hi swuehl,

I know this would be difficult but it would be really nice if you could please explain the logic behind your script for calculating age for.

I have failed to understand the actual logic of the individual fields that are calculated using functions (the purpose of creating the fields)

Regards,

Nadeem