Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

No GetPossibleSelections function

Hi all,

I am trying to create a dynamic list box where values are included only when a certain value has been selected elsewhere (may even be a compound condition).

There is the function GetFieldSelections which returns the explicitly selected values of a field, but there is no corresponding function to return those 'possible' values (implicitly selected in white).

I can create a function in module that uses 'ActiveDocument.Fields(fieldname).GetPossibleValues' but I cannot call this function in an expression.

Is there a way to achieve this?

Regards,

Gordon

8 Replies
amars
Specialist
Specialist

If I have understood ur problem correctly u can set an expression like

=IF(GetSelectedValues(FieldName)=Value, ValueToShow). Same way if u want to hide the List box u can set the expression in conditional like =IF(GetSelectedValues(FieldName)=Value,1,0) like that. IF have some othere requirement try using GetSelectedCount, GetPossibleCount etc.

Not applicable
Author

Thanks for the reply Amars.

Therein lies the problem. GetFieldSelections returns those values explicitily selected (green) but not those implicitily selected (white) although there are ironically the two functions GetSelectedCount and GetPossibleCount which distinguish between them.

Regards,

Gordon

Not applicable
Author

Gordon,

Did you ever find a solution. I've run into the same problem.

Thanks,

Josh

Not applicable
Author

Hey guys,

I'm not sure if this is a new function in QlikView 10 (I'm running build 8685, QV10RC2), but there is a GetPossibleCount system function. See this screenshot from help:

Not applicable
Author

Hi Jason,

Thanks the help. The problem is I wan to return the possible values not the count of possible values. The function GetFieldSelections returns the values of everything in green. I'm looking for something like GetFieldSelections but returns all possible values (i.e values that are green and white) vice selected values (i.e. values that are green). I guess it would be called GetFieldPossible or something.

What I am trying to do is figure out if the user filtered to a specific subset of data and use this to determine what objects are displayed.

Cheers,

Josh

johnw
Champion III
Champion III

Concat() returns possible values. Am I misunderstanding the question?

Not applicable
Author

No you're not! Wow that is much easier than I thought it would be. Thanks.

For others who come across this post:

Concat( FieldName , ',' )

will delimit each value with a comma so you can find the in the string that is returned.

i.e. item1,item2,item3 vice item1item2item3

johnw
Champion III
Champion III

You'd probably typically want concat(distinct FieldName,','), as without the "distinct", you'll get every occurrence of every value for the field. If you're trying to see if a value is possible, all those extra occurrences would only slow you down, even if it would still work.