Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Present databox only with unique years

Hello

I have a table with dates yyyy-mm-dd with more than 1000 dates between 2009 - 2011. I now what to create a databox that only shows the unique years to use as a filter.

2009

2010

2011

What I have done is to adjust the format to yyyy but all rows are shown in the box.

2009

2009

2009

2010

2010

etc

Can some one please guide me to fix this.

BR

Malte

1 Solution

Accepted Solutions
Not applicable
Author

Hi MAlte,

do not use expression tab of the listbox.

Please follow this exam: Create new Listbox --> General tab (= first tab) --> pull down menu "Fields" --> choose last entry (= <expression>) --> input into expression editor "Year(MyDate)".

That' it.

Roland

View solution in original post

6 Replies
Not applicable
Author

Hi malte,

I think you mean a listbox when saying databox. Try to use an expression like Year(MyDate) in a listbox.

Regards,

Roland

Not applicable
Author

Thank you for your answer.

Yes listbox is correct. Now I end up with this result?

BR

Malte

qlikview help.bmp

Not applicable
Author

Still not uniques presented.

Can someone please help me find the sollution to this?

BR

Malte

Not applicable
Author

Hi Malte,

Take that Year Field or Date Field and Goto Expression Tab in that Field.

if the Field is Date use the Below Expression:

if(WildMatch(Year(Date),'2009','2010','2011'),Year(Date)).

if the Field is Year then use below Expression :

if(WildMatch(YourYearFieldname,'2009','2010','2011'),YourYearFieldname)

Thanks & regards,

Santhosh Kumar G

Not applicable
Author

Hi MAlte,

do not use expression tab of the listbox.

Please follow this exam: Create new Listbox --> General tab (= first tab) --> pull down menu "Fields" --> choose last entry (= <expression>) --> input into expression editor "Year(MyDate)".

That' it.

Roland

Not applicable
Author

Now It works.Thank you Roland!

Have a nice weekend.