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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
bobbydave
Creator III
Creator III

Only certain dates.

I have a calendar that goes back as far as 2010.

I only want to show from 2014 onwards.

if(date(date#(Calls.Date, 'DD/MM'YYYY'), 'YYYY') >= '2014', Calls.Date)

So I am converting Calls.Date to a year and if it is greater than 2014, keep this.

I know there has to be an easier way.

Is there?

1 Solution

Accepted Solutions
sunny_talwar

May be this:

If(Year(Date#(Calls.Date, 'DD/MM/YYYY')) >= 2014, Calls.Date)

View solution in original post

3 Replies
sunny_talwar

May be this:

If(Year(Date#(Calls.Date, 'DD/MM/YYYY')) >= 2014, Calls.Date)

bobbydave
Creator III
Creator III
Author

Excellent.

Thanks.

jonathandienst
Partner - Champion III
Partner - Champion III

The date interpretation logic should be in your load script; as well as derived date fields. It will make expressions and sorting simpler to implement. So instead of

     LOAD

     ...

     Calls.Date,

Do this:

     LOAD

     ...

     date(date#(Calls.Date, 'DD/MM/YYYY')) As Calls.Date,

     Year(date(date#(Calls.Date, 'DD/MM/YYYY'))) As Calls.Year,


Now your front end expression is


     =If(Calls.Year >= 2014, Calls.Date)





Logic will get you from a to b. Imagination will take you everywhere. - A Einstein