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

Dynamic Dimension for Listbox

Hi QlikViewers,

Need one help please. I am trying to implement a list box for Year values. I want the list box to pickup year values from a source data filed "Fiscal Year" if vFiscalVariable = 1 and pickup year values from Source data field "Calendar year"  when vFiscalVariable = 0.

I have create a  button to toggle the value of vFiscalVariable to 0 and 1 on button click.

4 Replies
Not applicable
Author

Use the Conditional Show property to show one listbox or another:

Capture.PNG

JG

Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

You can either specify an Expression in the List Box or keep 2 "regular" List Boxes, one for the field Year and the other one fo the field "Fiscal Year", and show/hide one of the two List Boxes based on the toggle value. 

Not applicable
Author

I can hide for sure.

But wanted to use expression to achive that result using one listbox only. Any ideas

I can toggle the variable using a button action.

I also used an expression like this in the listbox. =if(vFiscalTgl = fy_year,calendar_year,fy_year). but it changes both Calendar and Fiscal values together.

Thanks

Raghu

Anonymous
Not applicable
Author

Please use the following steps to achive this:

1. Populate the field Fiscal year.

2. Right click on the Fiscal Year List box and go to the "Properties".

3. In the "General" tab you have "Field" dropdown.

4. Open this dropdown and select the last value which is "<Expression>".

5. Now enter the following formula: If(vFiscalVariable=1,[Fiscal Year],[Calendar Year])

The [Fiscal Year] and [Calendar Year] are your fields in the backend.

Thanks!!!

-Abhishek