There appears to be a bug pertaining to GetPossibleValues which manifests itself through the dynamic update feature (DynamicUpdateCommand).
Here is how to reproduce the bug:
- Create a two column data island table T1 (F1, F2)
- DELETE a value from this table using DynamicUpdateCommand
- Make a selection on two or more values in F1
- In VBScript execute GetPossibleValues
- Loop through all values and concat values into a single string
- You will notice that the last possible value is never returned
There are two ways to workaround this bug, depending on the scenario.
Scenario 1: You wish to use the possible values to restrict data within a chart (e.g. you are constructing a set expression, based on the possible values, and using the set exprssion in a chart).
In the scenario the workaround would be to instead use the P() function in your set expression to directly select these values. E.g. "{<F1=,F2=P(F2)>}"
Scenario 2: You will to take the list of possible values and submit them to another function (e.g. a stored procedure)
In this case you can use the Evaluate QlikView function to return the list. For example if you wanted to create a concated list of possible values with a pipe delimiter, the following VBScript would return this concatenated list:
ActiveDocument.Evaluate("Concat(distinct DPROF_description, '|')")
Hopefully at some point QlikView will be able to resolve this issue, since GetPossibleValues is much easier way to retrieve these values than through the Evaluate function.