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

AGE ANALYSIS

Hi,

I have a DOB Field & a LinkCommonDate in which I want to show age analysis

Which means which are the (Count()Employee) employees following in the age buckets

AGE ANALYSIS  %     | VALUE
VERTICAL18-2526-3536-4546-5556-60> 60
X
Y
Z
All

Thanks & Regards,

Renuka S

8 Replies
alexandros17
Partner - Champion III
Partner - Champion III

What is the problem?

Not applicable

Here we have to calculate the age of every employed with help of Current date - DOB and store in the other field.

Then we also i have make a Age_Bucket field which will have records

18-2526-3536-4546-5556-60> 60

Then we can show age analysis in the pivot chart as you wish to do so.

mdmukramali
Specialist III
Specialist III

Dear Renuka,

Kindly find the attache sample file.

I hope it will full fill your requirement.

        Replace(Class(Age(today(), DOB),10),'<= x <','-') as AgeRange; 

       //Dual('Age ('&Replace(Class(Age(today(), DOB),10),'<= x <','-')&')',Class(Age(today(), DOB),10)) as AgeRange;

Thanks,

Mukram

renuka_sasikumar
Creator III
Creator III
Author

Hi,

There is no any sample file attached

Thanks & Regards,

Renuka S

renuka_sasikumar
Creator III
Creator III
Author

Hi,

i have created the buckets in the front end. but it is not working without selection based.

mdmukramali
Specialist III
Specialist III

Dear,

Find the attached file.

Thanks

Mukram

Not applicable

Age Bucket.png

Is this what you wanted in the results?

vikasmahajan

Hii

Renuka  if you are using sql backend then create age buckets in script using following scripts

      'Age_Bucket' =

                      CASE

                          WHEN DATEDIFF(day, d_date_of_birth, GETDATE())/365  < 25 or DATEDIFF(day, d_date_of_birth, GETDATE())/365 IS NULL  THEN '< 25 Yr'

                          WHEN DATEDIFF(day, d_date_of_birth, GETDATE())/365 >=25 and DATEDIFF(day, d_date_of_birth, GETDATE())/365 <35  THEN '25-35 Yrs'

                          WHEN DATEDIFF(day, d_date_of_birth, GETDATE())/365 >=35 and DATEDIFF(day, d_date_of_birth, GETDATE())/365 <45  THEN '35-40 Yrs'

                          WHEN DATEDIFF(day, d_date_of_birth, GETDATE())/365 >=45 and DATEDIFF(day, d_date_of_birth, GETDATE())/365 <55 THEN '40-55 Yrs'

                          WHEN DATEDIFF(day, d_date_of_birth, GETDATE())/365 >=55  THEN 'Above 55 Yrs+'

                        

                      END

and then use this Age_Bucket Field in chart

I have implemented same logic . pfa sample chart image also.

Vikas

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.