Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Generate Date to age groups

I have [dateOfBirth] for patinets and i want to make group for them per ages

for example:

Age Group

00-15

16-31

32-47

47+

Regards,

1 Solution

Accepted Solutions
sunny_talwar

May be this expression in list box:

=Aggr(If(Age(today(), Only({1}dateOfBirth)) < 16, Dual('0-15', 1),

   If(Age(today(), Only({1}dateOfBirth)) < 32, Dual('16-31', 2),

   If(Age(today(), Only({1}dateOfBirth)) < 48, Dual('32-47', 3), Dual('47+', 4)))), dateOfBirth)

Capture.PNG

View solution in original post

6 Replies
Not applicable
Author

Using Today ( function) you can calculate the years of patinets . Through nested if we can establish groups . Regards.

sunny_talwar

Do you have a sample you can share?

Not applicable
Author

!Good evening, .qvw Attach a file. It can be seen as the deudaV2 , deudaV3 eyelashes ... I falsify dates . Regards.

Anonymous
Not applicable
Author

Check the attachment please for clear example

Regards,

Anonymous
Not applicable
Author

Check the last comment please.

Regards,

sunny_talwar

May be this expression in list box:

=Aggr(If(Age(today(), Only({1}dateOfBirth)) < 16, Dual('0-15', 1),

   If(Age(today(), Only({1}dateOfBirth)) < 32, Dual('16-31', 2),

   If(Age(today(), Only({1}dateOfBirth)) < 48, Dual('32-47', 3), Dual('47+', 4)))), dateOfBirth)

Capture.PNG