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: 
Anuhyak1
Creator
Creator

Dynamically change the label of the textbox based on status filter

I have   status filter which Final, In-progress,Not started  . 

Scenario :

If the user selects Final status from the filter   then CY 2023 should be displayed in the text box.

If the user selects In-progress   from the status filter   then CY 2022 should be displayed in the text box.

If the user selects Final   from the status filter   then CY 2017,2018,2019,2020 should be displayed in the text box.

 

 

Labels (7)
1 Solution

Accepted Solutions
Happy_Mask_Salesman
Partner - Contributor III
Partner - Contributor III

Hi.

So in the field Status we have three posible values 'Final', 'In-progress', 'Not started'. Am I right?

Use this formula if you're on Qlik Sense or recent QlikView version:

=Coalesce(Pick(Match([Status], 'Final', 'In-progress', 'Not started'), 'CY 2023', 'CY 2022', 'CY 2017,2018,2019,2020'), 'Select status')

Match(Status, ...) is returning a number between 1 and 3 depending on the selected value in Status.

Pick() Associates this number to each positioned parameter, 1 is CY 2023, 2 is CY 2022... and so on.

Coalesce() checks if the result of the inner operations Pick(Match()) has a valid representation, if doesn't, displays 'Select status'. This might happen when the filter is not used.

 

If doesn't work with coalesce() use this:


=if(GetPossibleCount(Status)=1,
Pick(Match([Status], 'Final', 'In-progress', 'Not started'), 'CY 2023', 'CY 2022', 'CY 2017,2018,2019,2020'), 'Select status')

GetPossibleCount() just checks how many current possible values are in the Status field.

 

Regards,

View solution in original post

1 Reply
Happy_Mask_Salesman
Partner - Contributor III
Partner - Contributor III

Hi.

So in the field Status we have three posible values 'Final', 'In-progress', 'Not started'. Am I right?

Use this formula if you're on Qlik Sense or recent QlikView version:

=Coalesce(Pick(Match([Status], 'Final', 'In-progress', 'Not started'), 'CY 2023', 'CY 2022', 'CY 2017,2018,2019,2020'), 'Select status')

Match(Status, ...) is returning a number between 1 and 3 depending on the selected value in Status.

Pick() Associates this number to each positioned parameter, 1 is CY 2023, 2 is CY 2022... and so on.

Coalesce() checks if the result of the inner operations Pick(Match()) has a valid representation, if doesn't, displays 'Select status'. This might happen when the filter is not used.

 

If doesn't work with coalesce() use this:


=if(GetPossibleCount(Status)=1,
Pick(Match([Status], 'Final', 'In-progress', 'Not started'), 'CY 2023', 'CY 2022', 'CY 2017,2018,2019,2020'), 'Select status')

GetPossibleCount() just checks how many current possible values are in the Status field.

 

Regards,