
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How can I calculate the age (in days) of a record given I have the creation date.
There is no "Date difference" (DateSub) function.
Using Date# does not work (If there is a difference between Date and Date#, I can not see it).
Using Today(1)-Num(Date(CreateDate)) {or Today(1)-Num#(Date#(CreateDate)) } does not work.
adding in Floor, etc. does not help.
It always shows as "-".
It seems as if CreateDate (which as a date hence a dual) will always be a date and so can not be subtracted from today.
There is networkdays (read as net work days) that does sort of what I want except I want to count weekend days also.
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
1st thing to check, is your date interpret correctly by Qlik Sense?
Once you have the fixed, Today(1) - Creation_Date should work. If for some reason it still doesn't work, please provide us with a sample so that we can help you better here.
Best,
Sunny

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
1st thing to check, is your date interpret correctly by Qlik Sense?
Once you have the fixed, Today(1) - Creation_Date should work. If for some reason it still doesn't work, please provide us with a sample so that we can help you better here.
Best,
Sunny

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There is no "Date difference" (DateSub) function.
the date difference is just a math subtraction
this is the difference between today and the beginning of the year
today(1) - MakeDate(2016)
maybe your CreateDate is not a date
and you need a format to interpret your CreateDate
Date#(CreateDate, 'herethedateformat')

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for your assistance.
The dates come from an SQL datebase (MQ SQL) .
CreatedDate is an SQL column of type datetime.
I also have [Created On] which is loaded from CreatedDate by Date(CreatedDate, 'YYYY-MM-DD') as "Created On",
Based on what you said I decided to use [Created On] instead and that works.
I do not know why CreatedDate did not work, it displays as a date and time etc.
So I reverted back to what I did in the beginning Today(1)-CreatedDate and now that works.
To get whole days I added a floor, floor(Today(1)-CreatedDate) and that is working now.
Maybe I has some other error that I did not recognize in the very first attempt.
Thanks again.
