Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator
Creator

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
Highlighted
Creator III
Creator III

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)

View solution in original post

2 Replies
Highlighted
Creator III
Creator III

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)

View solution in original post

Highlighted
Creator
Creator

Brilliant thanks!