5 Replies Latest reply: Sep 19, 2016 5:34 AM by Chris Neumann RSS

    Change the background colour based on a selection

    Marc van der Peet

      Dear all,

       

      I have the following Qlikview file in which I have created three pictures. Each of the pictures should fill the variable vColour1 with a different value. Then the background of the table box in the file should change based on the selection.

       

      I have taken the following steps

       

      - In the properties of the text objects (pictures) I have classified the actions "Select in field" and classified them as Label with a text.

      - The I added the following code in my load script:

       

       

      SET vCurrentLabel = LABEL;
      SET vKleur1
      = if ( vCurrentLabel = 'Eneco Consumenten B.V.' , RGB(210,18,66), 
      ( if ( vCurrentLabel = 'Oxxio', RGB(0,122,156), 
      ( if ( vCurrentLabel = 'WoonEnergie', RGB(209,221,27), 
      RGB(236,116,15) )))));

       

      Now when I click on the first picture (Eneco) I see the background is indeed changing to right colour((210,18,66). However when I click on of the other labels the background is not changing while I was expecting that when I clicked on the Oxxio picture the background would change to (0,122,156).

       

      Could anybody see what goes wrong here?

       

      Cheers,

      Marc