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

How to be able to switch between 2 field value in List box

Hi,

I've requirement on creating a switchable of 2 type of calendar (Iso and 4-4-5) to be display in the report.

In my data model I've only 1 dim calendar which contain 2 type of week,month,quarter and year (eg. week, week445, month, month445, quarter, quarter445, year, year445)

The user can select whether ISO and 445 type to be filter the report for example if user select 445 calendar the below year 2021 should use field year445 in dim calendar for the list box but in the other hand if user select ISO calendar the filed to be use in list box will be year.

chayaphon_0-1614052707412.png

So according to my requirement would it be possible to do that ? and how to?

thank you for your advise.

4 Replies
srishsum2017
Creator
Creator

Please try to create calculated field on your list box with If-else or pick match on Selection basis. You have to make it conditional. Please share your sample file if it is possible.

Sumit Kumar Srivastava
chayaphon
Contributor
Contributor
Author

Hi Sumit ,

Thank you for your advise, I've tried your solution by put the following code in List box expression 

 

=IF(SubStringCount(_Help_TableCalendarTypeDimensionsNameUnique,'/ISO Calendar/')>0,Calendar_Year,Calendar445_Year)

 

chayaphon_1-1614129459239.png

Remark : Where _Help_TableCalendarTypeDimensionsName is in another List box to select the Calendar type.

But when I click on the year listbox the selection box will also select both the value of Calender_year and Calendar445_year, also the quater box if there is some quarter has intersect data it will also select multiple value of both field (eg. in year 2021 quater1 may be include week 14 while week 14 in 445 is qurter2 so the selection box will select multiple both Q1 and Q2when pressing only Q1 cause there are some data of Iso Q1 also present on 445 Q2)

chayaphon_0-1614129090008.png

chayaphon_2-1614129773312.png

I've tried using the two different field in the same dimension and also separate it into 2 different dimension but it seem still doesn't work as expected.

it seem like List box doesn't support multi field selection independently.

For the report file Im afraid that I can't share to public due to it's a company information and sensitive data.

srishsum2017
Creator
Creator

Hi, So please take 2 different list boxes for all the dimensions and show and hide them conditional on selection basis.

When you select calendar ISO so all list boxes related to calendar ISO will show in application and when you select calendar 445 so al list boxes related to it will show in application

Sumit Kumar Srivastava
marcus_sommer

Just add another field to the island-table of [_Help_TableCalendarTypeDimensionsName] which contained the appropriate Field-Suffix which is in your case either an empty string '' or 445. Afterwards you could set your listboxes with an expression like:

[Year$(=[Field-Suffix])]

Another way would be to control the visibility of the objects with the selections from [_Help_TableCalendarTypeDimensionsName] whereby in your case it might be an option not to apply it to all period-listboxes else you may put them into a container and show/hide them.

- Marcus