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: 
Anonymous
Not applicable

help in list box expression

Hi

i have list box containing Sales_date .It has date from 2011 to 2015.

I need the only years of the sales_date like year(Sales_date).I need only distinct values like 2011,2012,2013,2014,2015.

Thanks

17 Replies
fred_s
Partner - Creator III
Partner - Creator III

Hi,

Create a listbox

Field <Expression>

=year(YourDate)

So you found the answer yourself.

Grtz Fred

MK_QSL
MVP
MVP

While Loading data in script just below Sales_date create one more field

Year(Sales_date) as Sales_Year

now you can use Sales_Year field in List Box..

fred_s
Partner - Creator III
Partner - Creator III

Yep, Manish's answer is the way to go, but since rand knew the year() function, I've assumed it was not what he was looking for.

Anonymous
Not applicable
Author

Hi Fred,

Thanks for reply ! But i need only distinct year values. I am getting multiple year values.

Thanks

Anonymous
Not applicable
Author

Hi

Thanks for the reply !!

But i need only distinct year values. I am getting multiple year values.



Thanks

fred_s
Partner - Creator III
Partner - Creator III

Show us an example of what you would like to achieve.

This is what I get and to me it's pretty distinct:

years.JPG

Anonymous
Not applicable
Author

Hi ,

I need the same as above .

Thanks

PrashantSangle

Hi,

What is your date format??

Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
nagarjuna_kotha
Partner - Specialist II
Partner - Specialist II

Hi,

Can U share ur sample Data  ?

Regards,

Nagarjuna