8 Replies Latest reply: Jun 21, 2011 8:53 AM by AXON SG RSS

    possible to have field names in a list box?

      hi guys,

       

      1) is it possible to have field names of a table in a list box?

       

      table1 has fieldA, fieldB and fieldC...

       

      a list box will have fieldA, fieldB and fieldC as its options...

       

      2) if part 1 can be done, can i adjust the chart based on the option selected in the list box?

       

      whenever i choose fieldA, a calculation based on fieldA will appear on the chart and whenever i choose fieldB, a calculation based on fieldB will appear on the same chart...

       

      2) or can i hide charts based on selections?

       

      when i select fieldA, the chart based on fieldA will appear and the charts for fieldB and fieldC will be hidden from me and when select fieldB, the chart based on fieldB will appear and the charts for fieldA and fieldC will be hidden from me...

       

      thanks in advance

        • Re: possible to have field names in a list box?
          Miguel Angel Baeyens de Arce

          Hello,

           

          Yes, it's possible. You can create a new listbox and set an expression with

           

          =$Field
          

           

          To get all the fields you have loaded in your model.

           

          And you can use

           

          =GetFieldSelections($Field)
          

           

          To get the name of the field selected, and use it later as part of an expression.

           

          Anyway, I'd create variables in the script with the fields or formulas you want to use and let the user select among this variables.

           

          To show conditionally a chart, go to the chart properties, Layout tab, and set there the conditional, something like

           

          GetFieldSelections($Field) = 'Field1'
          

           

          So the chart will be displayed only if Field1 is selected. Any valid expression in QlikView can be used in this conditional.

           

          Hope that helps.

           

          Miguel Angel Baeyens

          BI Consultant

          Comex Grupo Ibérica