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

Calculated Date Dimension with if Statement

I'm trying to limit a date dimension by using an "if" statement as follows to allow the last 12-months to be shown in  particular chart as follows

if(Mydate>today()-365, Mydate,"")

I would then exclude null values. I have tried multiple ways of doing this but can't make it work - I can evaluate the formulae e.g. today()-365 in an expression but not making it work in the if statement.

I'm probably missing something really obvious but would be grateful if someone could help me.

Thanks

Kevin  

 

1 Solution

Accepted Solutions
kevinstanfield
Partner - Creator
Partner - Creator
Author

That's great  - thanks very much for your contribution

View solution in original post

2 Replies
bharathadde
Creator II
Creator II

try this

=if(date(Mydate,'MM/DD/YYYY')>Date(today()-365,'MM/DD/YYYY'),date(Mydate,'MM/DD/YYYY'))

kevinstanfield
Partner - Creator
Partner - Creator
Author

That's great  - thanks very much for your contribution