Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Phunshey
Contributor II
Contributor II

List Box for Year

Hello, 

I am new to Qlikview. Apology for asking this question if it is foolish one. I am trying to create a list box for Year. For some reason I get year from 1899 till 2021 even though I have data for 2019 and 2020 only. How do I show only 2019 and 2020 in my list box? I tried looking around in internet but no joy. 

Kind regards,

Phunshey 

1 Solution

Accepted Solutions
eddie_wagt
Partner - Creator III
Partner - Creator III

Hello @Phunshey 

It probably had something to do with your calendar table. If you click the year 1899 and nothing is being associated, then you have too many years in your calender. I suggest that you restrict the years in the calendar in loadscript by adding a where clause.

Examples where you want to see Year greater of equal to 2010

Calender_example:
LOAD Year
,    Datefield
,    blabla
From table
Where Year>=2010 
;

 

Otherwise you can have a workaround in frontend.

Select 'Calculated dimension' from the properties as Field. Put the following expression in:

aggr(only({$<Year={'>=2010'}>}Year),Year)

Regards Eddie

View solution in original post

3 Replies
eddie_wagt
Partner - Creator III
Partner - Creator III

Hello @Phunshey 

It probably had something to do with your calendar table. If you click the year 1899 and nothing is being associated, then you have too many years in your calender. I suggest that you restrict the years in the calendar in loadscript by adding a where clause.

Examples where you want to see Year greater of equal to 2010

Calender_example:
LOAD Year
,    Datefield
,    blabla
From table
Where Year>=2010 
;

 

Otherwise you can have a workaround in frontend.

Select 'Calculated dimension' from the properties as Field. Put the following expression in:

aggr(only({$<Year={'>=2010'}>}Year),Year)

Regards Eddie

Phunshey
Contributor II
Contributor II
Author

Thank you @eddie_wagt . The first solution worked. 

eddie_wagt
Partner - Creator III
Partner - Creator III

@Phunshey great to hear. Happy qliking! 😊