Selection In List Box Defined With An Expression

    Defining a list box with an expression instead of field can be a tricky thing to master.

     

    In the example below the value Oct is selected in the list box, while the Current Selections object shows that the value October is selected.

    2015-06-06 17_51_48-QlikView x64 - [C__Users_tko_Documents_Community Content & Material_Content - Ca.png

    In a closer look the list box is defined as an expression. This means that the expression must be translated into a virtual dimension, that is mapped into the data model. Basically the expression needs to be associated with one or more fields int he data model, so that selections in the list box can be applied to the application's data model.

    2015-06-06 17_53_57-Edit Expression.png

    In this case the associated field will be LongMonthName due to the structure of the expressions. This specific setup is equal to a straight table with the Aggr() dimension(s) as dimensions and the Only() aggregation as expression. In QlikView selections are naturally always done on dimensions, so selecting the expression value Oct will actually select the corresponding dimension value. 

    2015-06-06 18_03_33-QlikView x64 - [C__Users_tko_Documents_Community Content & Material_Content - Ca.png

    The result is now just the same as when the similar selection is made in the list box. The selection applied from a expression based list box in general is not magical, it just depends on how the expression is associated with the data model.

    2015-06-06 18_05_40-QlikView x64 - [C__Users_tko_Documents_Community Content & Material_Content - Ca.png

    It is advisable to use the Current Selections box as validation of actual selections when working with complex expression in list boxes.

     

     

    PS. I use this specific setup at times when my month selection needs to be slim, but I still want the current selection to show the full month.