Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

GetSelectedCount() workaround for alternate states

I have a trigger that does a "Select in Field" based on another field using Search String:

     = if ( GetSelectedCount( blob ) = 0, '', blob)

This meet my requirements were selections are copied if:

     1) a single value is selected

     2) multiple values are selected

     3) no values are selected

So, now I introduce states and I am not longer able to use GetSelectedCount() and must use other function in order to specify the State. So, I currently have:

     = '(' & Concat( {StateA}blob, '|' ) & ')'

This meets the first two requirements (single and multiple selections) but if no values are selected it ends up selecting all of them. I was working on doing something like below, but none of these worked:

     = if ( '(' & Concat( {StateA}blob, '|' ) & ')'  = '()',     // if the concat function returns nothing

          '',                                                                           // select nothing

          '(' & Concat( {StateA}blob, '|' ) & ')' )               // else select the selections

So, what does Concat return when nothing is set for {StateA} blob???

1 Solution

Accepted Solutions
Not applicable
Author

This does it:

= if ( Concat({StateA} GetFieldSelections(blob)) = '' ,

'',

'(' & Concat( {StateA}blob, '|' ) & ')' )

View solution in original post

1 Reply
Not applicable
Author

This does it:

= if ( Concat({StateA} GetFieldSelections(blob)) = '' ,

'',

'(' & Concat( {StateA}blob, '|' ) & ')' )