Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

List Boxes

If i had a QV doc with 2 list boxes for month and year what would be the best way to select say March 2010 - March 2011.

Any help would be appreciated, Thanks!

1 Solution

Accepted Solutions
Not applicable
Author

Hi brianm10 ,

now i got. i have a scenario.

step1: Take two varaibles for capturing the from Year and from Month, vFromYear, vFromMonth

step2: Take another two variables for capturing the ToYear and ToMonth, vToYear, vToMonth

step3: Now take a button for capturing data from both our list boxes and put into the varaibles vFromYear, vFromMonth. for this

Add two actions for the button, SetVariable action - give varaible name as vFromYear and value as =YearFieldName

SetVariable action - give varaible name as vFromMonth and value as =MonthFieldName

Now we have puted the selected values into our variables.

step4: Now take another button and do as like the Step3 for the variables ToMonth, vToYear, vToMonth.

step5: Now take another button for making selection by using our four variables.

add action Select In Field and give a your YearfieldName (on which field you want to make selection)and in the value box give condition like:

='>=' & vToYear and '<='&vToYear

add another action Select In Field and give a your MonthrfieldName (on which field you want to make selection)and in the value box give condition like:

='>=' & vToMonth and '<='&vToMonth

SCENARIO: first select one year value inyour Year listbox and select one month value in the month list box and click the first BUtton.

now select year value in the same year list box and month value in the same month field and clik second button.

now clik the final button. Please change the conditions as you like....

View solution in original post

9 Replies
Not applicable
Author

Hi brianm10 ,

i didn`t get anything. could you explain clearly..

Not applicable
Author

Apologies for not being clear enough.

On my QV document I have a List Box for Years, so a box with options for 2008, 2009, 2010, 2011

Then I also have a List Box for months, so Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec

My question is what would be the best way to choose the selection March 2010 to March 2011?

Not applicable
Author

Hi brianm10 ,

now i got. i have a scenario.

step1: Take two varaibles for capturing the from Year and from Month, vFromYear, vFromMonth

step2: Take another two variables for capturing the ToYear and ToMonth, vToYear, vToMonth

step3: Now take a button for capturing data from both our list boxes and put into the varaibles vFromYear, vFromMonth. for this

Add two actions for the button, SetVariable action - give varaible name as vFromYear and value as =YearFieldName

SetVariable action - give varaible name as vFromMonth and value as =MonthFieldName

Now we have puted the selected values into our variables.

step4: Now take another button and do as like the Step3 for the variables ToMonth, vToYear, vToMonth.

step5: Now take another button for making selection by using our four variables.

add action Select In Field and give a your YearfieldName (on which field you want to make selection)and in the value box give condition like:

='>=' & vToYear and '<='&vToYear

add another action Select In Field and give a your MonthrfieldName (on which field you want to make selection)and in the value box give condition like:

='>=' & vToMonth and '<='&vToMonth

SCENARIO: first select one year value inyour Year listbox and select one month value in the month list box and click the first BUtton.

now select year value in the same year list box and month value in the same month field and clik second button.

now clik the final button. Please change the conditions as you like....

Not applicable
Author

Thank you sir, very much appreciated!

Not applicable
Author

Hi Brainm10,

Please take back your "Sir".

We are FRIENDS......

Not applicable
Author

Thank you friend!

Not applicable
Author

As I'm trying to implement this in my document, I'm becoming a little confused.

The first step is to make create the variables for the vFromMonthYear and vToMonthYear

Secondly, I create 2 buttons to store the data for these variables? (can a button store data?)

Then I create a third button to compute the actual end result?

Is this the correct process? Thanks

Or
MVP
MVP

This isn't strictly what you asked, but these days, I no longer display individual months (Jan-Dec) as a selection - rather, I display months in MonthName() format (e.g. Jan 2011). Depending on your layout, this can fit into a listbox of a multi-box, but regardless of how you display it, it allows for easy selection of multiple months across years. Users seem to find this a lot more intuitive than any alternative solution I've offered, but if your users specifically prefer the individual-month format, you can offer a selection of both individual month and MonthName() format.

Not applicable
Author

Thanks, both great ideas but i think I'll go with the easier one, Cheers