Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
BI & Data Trends 2021. Discover the top 10 trends emerging in today. Join us on Dec. 8th REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Partner
Partner

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
Highlighted
Partner
Partner

That's great  - thanks very much for your contribution

View solution in original post

2 Replies
Highlighted
Creator II
Creator II

try this

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

Highlighted
Partner
Partner

That's great  - thanks very much for your contribution

View solution in original post