Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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')
You can try some thing like this =count({State name}field)
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
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
Did vote there.
Thanks!
Vladimir
is there any way to get selected field value in alternative states?
something like getfieldselections([state1],field)
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
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')
Vegar Lie Arntsen,
Thank you for feedback!
Will test the new functionality.
Regards,
VK
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.