6 Replies Latest reply: Jan 25, 2017 10:16 AM by Aaron Morgan RSS

    How to make GetCurrentSelections return multiple values once using multiple Select in Field

    Aaron Morgan



      Coming across a problem with how current selections represents a field due to using a select in field statement that's aiming to select multiple values. When you push the selection, the field itself selects all the correct values, but instead of GetCurrentSelections returning a number of values, it returns the exact string that's been passed to it, and therefore isn't bound by the max values constraint.

      (FYI: I'm currently using Qlikview 11.2 SR7 for various reasons!)


      As an example, we use a button that has a select in field trigger attached to it to pick out multiple values of a particular field, say the field is ProductCode and the select in field search string is: (A100|A101|B102|B103|C104|C105|D106)


      On applying, the field ProductCode will correctly select those 7 values, but when using a current selections box or using the function GetCurrentSelections, even with max values set to lower than the default 6, it will return the exact string for ProductCode. What I want it to do is use the default behaviour of saying "7 of X" selected.


      I can create a custom string by using the GetSelectedCount and GetFieldSelections functions along with using an if statement to control when to show or when not to show, but I'd much prefer to have this as part of a Current Selections string with the rest of my fields, especially within a native current selections box, though that's not critical to the requirement.


      As a note, the product codes above are examples - they can be anything from a range of values so I can't use a wild to try and pick out a set formula; this set of products is actually derived from a search string evaluating sales over a set periods of time and returning only those products that have sold less than a number input by the user.


      Any help, alternative solutions or steers appreciated!