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

Create a Bar Chart of Ages

Hi All

I need to be able to filter results by age in Qlikview but age is not a column within my Oracle database table, DOB is.

The data is coming from an Oracle database, I can import the data into Qlikview  using the command Select * from uk_pay_dev.pay_basic_info_raw into the script editor, but I am not able to work out how to turn the DOB into age so that I can use age as a 'filter'/ thing I can click on where it goes green/grey/white.

I hope this makes sense

Many thanks

3 Replies
m_woolf
Master II
Master II

something like:

floor((today() - DOB)/365.25) as Age

ecolomer
Master II
Master II

You can use also AGE function, but the results are only year integer

AGE(Today() - DOB) as Age

maxgro
MVP
MVP

From Qlik online help

age(timestamp, date_of_birth)

Returns the age at the time of timestamp (in completed years) of somebody born on date_of_birth.

Examples:

age('2007-01-25', '2005-10-29') returns 1

age('2007-10-29', '2005-10-29') returns 2

load

    *,

    age(today(), DOB) as Age          // new field

    ;

SQL

    Select

          *

     from uk_pay_dev.pay_basic_info_raw

    ;