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: 
knightwriter
Creator III
Creator III

Expression to equal 2015

Hi all

I have the expression below and the answer I get is -1 and 0. I have a list of medals won by date and I want only the ones in 2015. Can you please help? And what is wrong with the below expression?

=year([Medal.Win Date])=2015

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Perhaps this expression does what you want: only({<[Medal.Win Date]={"=Year([Medal.Win Date])=2015"}>}[Medal.Win Date])


talk is cheap, supply exceeds demand

View solution in original post

6 Replies
sunny_talwar

May be this:

Dimension: Date

Expression: Count({<Year = {2015}>}[Medal.Win Date])

This should give you the count of medals on all dates.

HTH

Best,

Sunny

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Your expression is a test. It tests if the result of year([Medal.Win Date]) is 2015. That test is either true (-1) or false (0). That's why you get -1 and 0 values.


talk is cheap, supply exceeds demand
knightwriter
Creator III
Creator III
Author

Hi Sunny,

Thanks for the suggestion, this works but I am looking for the column to show the year '2015' and for that column to show only 2015 data.

Thanks

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Perhaps this expression does what you want: only({<[Medal.Win Date]={"=Year([Medal.Win Date])=2015"}>}[Medal.Win Date])


talk is cheap, supply exceeds demand
sunny_talwar

Use expression Label as '2015'

knightwriter
Creator III
Creator III
Author

Hi Sunny,

Thanks for the response. I dont actually want to change the Column title but to have the column contents show the year 2015 in the cells rather than 1 etc.

I have this sorted thanks to the above expression. Thanks again for your help.