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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
ali_hijazi
Partner - Master II
Partner - Master II

getCurrentSelections

Hello

I know that the function getCurrentSelections gives the names of the fields with the selected values

and if Clear is clicked this function will return null

is there a way to check that there is selection on all fields except for some specific fields

I want to check if the user at least selected any value of any column in the schema but ignore selections made on some specific fields

is this possible ?

Please advise

I can walk on water when it freezes
Labels (1)
1 Solution

Accepted Solutions
johanlindell
Partner - Creator II
Partner - Creator II

Well, it is definately possible.

This formula should do the trick:

=$(='RangeSum(' & Concat ({<[$Field] =- {'My exclude field 1', 'My exclude field 2'}>} 'GetSelectedCount([' & [$Field] & '])', ', ') & ')')

If you want to show the formula in text you can paste this into a text box:

='RangeSum(' & Concat ({<[$Field] =- {'My exclude field 1', 'My exclude field 2'}>} 'GetSelectedCount([' & [$Field] & '])', ', ') & ')'

It creates a dynamic expression using the hidden field for all fields, $Field and uses Set Expression to exclude certain fields. Example

=RangeSum(GetSelectedCount([History]), GetSelectedCount([Issues]), GetSelectedCount([ToDo]))

View solution in original post

3 Replies
marcus_sommer
MVP
MVP

You could use various string-functions like subfield(), index(), (wild)match() to search within the getcurrentselections-result but I think to use multiple getfieldselections() or getselectedcount() queries will be easier.

Another possibility might be to use a count-function with some conditions over alle your needed fields and values maybe like: count({< Field1 = {'Value1'}, Field2 = {'Value2', 'Value3'} >} Field1&Field2) which returned a value >=1 = true or 0 = false.

- Marcus

johanlindell
Partner - Creator II
Partner - Creator II

Well, it is definately possible.

This formula should do the trick:

=$(='RangeSum(' & Concat ({<[$Field] =- {'My exclude field 1', 'My exclude field 2'}>} 'GetSelectedCount([' & [$Field] & '])', ', ') & ')')

If you want to show the formula in text you can paste this into a text box:

='RangeSum(' & Concat ({<[$Field] =- {'My exclude field 1', 'My exclude field 2'}>} 'GetSelectedCount([' & [$Field] & '])', ', ') & ')'

It creates a dynamic expression using the hidden field for all fields, $Field and uses Set Expression to exclude certain fields. Example

=RangeSum(GetSelectedCount([History]), GetSelectedCount([Issues]), GetSelectedCount([ToDo]))

ali_hijazi
Partner - Master II
Partner - Master II
Author

thank you

I can walk on water when it freezes