Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
mattphillip
Contributor

Counter for number of current selections

Hoping someone can help. I'm using the below code to count the number of selections currently made which I'm mounting within a small text box as a small indicator to remind users when selections have been made (without the need to fully open the current selections box itself. My issue is scripting the conditional coding so it hides again when there are no selections made. Currently the below script produces the result of '-' when there are no selections. However, when I try my statement, see below, it doesn't work.

Does anyone have any idea why this might be the case?

Current Selections Counter Object

SubStringCount( GetCurrentSelections(':', ',', '@', 100), ':')+1

Conditional statement

SubStringCount( GetCurrentSelections(':', ',', '@', 100), ':')+1<>'-'

Any help would be most appreciated.

Matt

1 Solution

Accepted Solutions
thomaslg_wq
Contributor III

Re: Counter for number of current selections

If there are no selections the results of the function "getcurren.." = null

1 - you cannot add a number to null : the output is null
2 -a null output is often visualized as "-" in Qlik, but it does not equal the string "-"

Instead, use this in condition:
if(isnull(SubStringCount( GetCurrentSelections(':', ',', '@', 100), ':')),0,1)
2 Replies
thomaslg_wq
Contributor III

Re: Counter for number of current selections

If there are no selections the results of the function "getcurren.." = null

1 - you cannot add a number to null : the output is null
2 -a null output is often visualized as "-" in Qlik, but it does not equal the string "-"

Instead, use this in condition:
if(isnull(SubStringCount( GetCurrentSelections(':', ',', '@', 100), ':')),0,1)
mattphillip
Contributor

Re: Counter for number of current selections

Brilliant thanks!