Qlik Community

App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
Customer & Partners, DEC. 9, 11 AM ET: Qlik Product & Strategy Roadmap Session: Data Analytics REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
VivenReddy
Partner
Partner

Debugging Select in Field trigger

I have a list box for the CMR_Desc field which works as intended. The CMR_Desc field comes from a table which is a data island.  

VivenReddy_0-1622221140043.png

When a value is selected the report adjusts accordingly.

VivenReddy_1-1622221327691.png

The problem started after I added a Select in Field trigger so that this list box maintains a default value even when the everything is cleared. I used the expression below to create the trigger. I have used the same expression is other reports and it works as expected.

=if(GetSelectedCount(CMR_Desc)<>1, 'All', CMR_Desc)

However on this report it seems like only the 'All' value maintains the selection.

VivenReddy_3-1622222171346.png

 

If any other value is clicked on, the list box is cleared and nothing is selected

VivenReddy_2-1622221859487.png

Does anyone have any idea what could possibly cause this or can advise how to debug this issue? Unfortunately  I'm unable to provide the qvw file. 

1 Solution

Accepted Solutions
rwunderlich

Your values have spaces so you need to enclose the desired value in quotes. 

=if(GetSelectedCount(CMR_Desc)<>1, 'All', chr(39) & MinString(CMR_Desc) & chr(39)) 

-Rob

View solution in original post

7 Replies
rwunderlich

I don't believe you can select multiple values by specifying the fieldname alone.  Or are you trying to select just one CMR_Desc?

MinString(CMR_Desc)

-Rob

VivenReddy
Partner
Partner
Author

Thanks for responding Rob.

The aim here is to only have 1 value selected with the Default value being 'All' (not all values. Just 1 value 'All'). As I said in the post my current methodology is working in another report. I don't know of any way to to debug this issue.

Any guidance would be appreciated.

rwunderlich

=if(GetSelectedCount(CMR_Desc)<>1, 'All', MinString(CMR_Desc))

Also, do you have "Always one selected" set on for this field?

-Rob

VivenReddy
Partner
Partner
Author

I tried your expression above. Its not working as well. Its behaving the same  as my previous expression.

We cannot use 'Always One Selected Value' as we have to Reduce Data and Remove All Values before we make the report available to our users who then reload the report with their data.

VivenReddy
Partner
Partner
Author

I have managed to replicate the issue in a simple file. You'll see that I'm unable to select any option except for 'All'. When the trigger is removed I can select anything.

rwunderlich

Your values have spaces so you need to enclose the desired value in quotes. 

=if(GetSelectedCount(CMR_Desc)<>1, 'All', chr(39) & MinString(CMR_Desc) & chr(39)) 

-Rob

View solution in original post

VivenReddy
Partner
Partner
Author

Thank you Rob. Appreciate your assistance. I'm humble when legends like you take the time to assist others.