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

How to get Month and Year Listboxes working together?

Hi,

I have a field called MonthDate ('YYYY-MM-DD', shown on the far right of the image below) and I would like to create two listboxes; one for Year and the other for Month. If you look below, I have done this by using expressions YEAR(MonthDate) and MONTH(MonthDate) on the 2 separate listboxes. Now the issue is that when I select a month, all the values where that month occurs get selected (see the list box on the far right) and when I select the Year (under the impression that my Month value will remain) all the Months are selected.  Please help!

1 Solution

Accepted Solutions
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     Its better to create this fields in script.

     If you do that, this problem will be solved.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!

View solution in original post

6 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     Its better to create this fields in script.

     If you do that, this problem will be solved.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
er_mohit
Master II
Master II

you have to do this in script side like

load Date(Date#(MonthDate ,'YYYY-MM-DD',),'YYYY-MM-DD') as Date,

year(MonthDate) as Year,

Month(MonthDate) as Month

from table;

hope it helps you

Not applicable
Author

Good Day Kaushik,

I'm not sure I follow. Do you mean, I leave the MonthDate field and create additional columns, say "Year" and "Month", and use them in my list boxes instead?

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Yes you are right.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

Thanks er.mohit! Your and Kaushik's solution helped.

Not applicable
Author

Thanks Kaushik! Your and er.mohit's solution helped.