Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Save the Date: QlikWorld Online, June 24-25, 2020. Free global virtual event for data integration and data analytic gurus. Register Today
Partner
Partner

GetSelectedCount and Alternative State

Hello!

Is it possible to use an Alternative State option for functions like GetSelectedCount()?

I need to check the number of items selected for the field that has the Alternative State set for.

I will appreciate any suggestions.

Best regards,

Vladimir

1 Solution

Accepted Solutions
Highlighted
Partner
Partner

Re: GetSelectedCount and Alternative State

Your problem will be solved in the QlikView 11.20 SR8.

Qlikview 11.20 service release 8 beta is now available

New parameter added to the functions “GetSelectedCount()”, “GetFieldSelections()and“GetCurrentSelections()” to query other states than the main state. E.g. =GetFieldSelections(Quantity, ';', ,'StateA')

Plees ekskuse my Swenglish and or Norweglish spelling misstakes

View solution in original post

9 Replies
Highlighted
Not applicable

Re: GetSelectedCount and Alternative State

You can try some thing like this =count({State name}field)

Highlighted

Re: GetSelectedCount and Alternative State

There is no option for that.

Those functions acts based on the object state. If your using this in text object then that object state should be in that state.

You can vote up the idea her http://community.qlik.com/ideas/2340

Highlighted
Partner
Partner

Re: GetSelectedCount and Alternative State

Yes, I saw this idea in the "Suggestions" article (http://community.qlik.com/ideas/2340). It works, but it's affecting performance of my application significanly. I have very unusual case, but it should work much faster with standard GetSelectedCount implementation...

Thanks!

Vladimir

Highlighted
Partner
Partner

Re: GetSelectedCount and Alternative State

Did vote there.

Thanks!

Vladimir

Highlighted
Not applicable

Re: GetSelectedCount and Alternative State

is there any way to get selected field value in alternative states?

something like getfieldselections([state1],field)

Highlighted
Employee
Employee

Re: GetSelectedCount and Alternative State

If you have a field in the default state that matches the one in the comparison state, you can count all values in the field from the default state and subtract a distinct count from the comparison state. If the value is less than zero, then something has been selected.

Its not pretty, but here is an example:


Count(distinct {[Compare1]} Field) - (GetSelectedCount(Field)+GetAlternativeCount(Field)) < 0

Highlighted
Partner
Partner

Re: GetSelectedCount and Alternative State

Your problem will be solved in the QlikView 11.20 SR8.

Qlikview 11.20 service release 8 beta is now available

New parameter added to the functions “GetSelectedCount()”, “GetFieldSelections()and“GetCurrentSelections()” to query other states than the main state. E.g. =GetFieldSelections(Quantity, ';', ,'StateA')

Plees ekskuse my Swenglish and or Norweglish spelling misstakes

View solution in original post

Highlighted
Partner
Partner

Re: GetSelectedCount and Alternative State

Vegar Lie Arntsen,

Thank you for feedback!

Will test the new functionality.

Regards,

VK

Highlighted
Not applicable

Re: GetSelectedCount and Alternative State

In case it helps others...

I think it's worth noting that I have also experienced appalling performance degradation on a complex application which also used the suggested workaround.  I tracked this degradation down to the use of this logic:

SubStringCount('|'& Concat(DISTINCT {AdHoc} $1,'|')&'|', '|'& $2 &'|' )>0

I had a large number of customisable tables which had expressions and dimensions that could be dynamically selected by users.  By removing this logic, and instead using a system field in the default state in conjunction with some logic that Rob Wunderlich had mentioned in a comment on another post (sorry - can't find the link now - I think it was on the sample app using bitand/bitor), the performance improved dramatically.

This is the new logic I am using.

GetSelectedCount($1) AND max(match($1,$2))

So whilst the SubStringCount work around did work to get values from an alternate state (pre 11.2 sr8), use it cautiously as it may have performance implications.