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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Date formatting problem

I got a field (Bdate) which consists of a birthdate in a textformat like this 050453.

I´d like to load the field formatting it to a real date and looking like this 05-04-1953 so I can make a script that calculates the age

AGE(today(),Bdate) as Personage

What do I do?

16 Replies
Not applicable
Author

can use Or Age

Age (Date(today(),Date(Date#(Bdate,'DDMMYY'),'DD-MM-YYYY')))

other function is interval

Not applicable
Author

Using this IF makes no ages - its all blank

Not applicable
Author

I now got a date like this 07-06-64

How would you make a script solving the problem with 64 and 63

hic
Former Employee
Former Employee

You need to decide yourself which cutoff you want. One way is to use

     If( Year(Date) > 2020, AddYears(Date,-100), Date) as NewDate

where Date is your expression that interprets the date. Then all dates after 2020 will be "moved" 100 years back in time.

HIC

Not applicable
Author

I´m not quite sure that I understand.

I got a field AGE starting with -50 to 50.

All ages with minus got birthdates before 1964.

All positiv numbers are ok ages

hic
Former Employee
Former Employee

Then you can use an expression where you don't accept negative ages:

     IF( Age<0, Age+100, Age) as NewAge

HIC

DavidFoster1
Specialist
Specialist

Sorry to moan but...

Can people please read whole threads before responding. There are so many similar responses here that it is difficult to find the best one. In this case please look at Henric's reponse who (as usual) has it spot-on.