Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
Hi Marc, You may need to add the .qvw file for us to look at.
Just ensure your descriptions are not case sensitive and that selections are exactly the same as in your if statement.
Should be names and nothing too complex.
Kind regards
Chris
My guess would be that your select in field actions are not entirely set up correct. But I can't see that from here. Perhaps you can post a small qlikview document that demonstrates the problem.
To test this to see where it is going wrong, I would just create another text object, and enter '= vCurrentLabel', then click on your Oxxio picture and see if it shows the value you are expecting.
Also, I think there are some extra brackets you don't need in your vKleur1 variable, I'm not sure if this is affecting it, but try this:
= 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) )));
Hi Gysbert,
I forgot to add the file. I uploaded it now... Does this help?
Cheers,
Marc
There's no field LABEL in the document you posted. I've used the field Netbeheerder instead.