Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I am trying to have one of two images appear conditionally. The two images are in the Qlik Sense Media Library. But when I try to use an If statement in the Text/Image object to make them appear, only the file location name appears, not the actual image. Can someone tell me what the proper syntax is? Or is this not possible?
if(LowerIsBetterFlag = 1, '/content/Icons/Desired Direction - Down.png',
if(LowerIsBetterFlag = 0, '/content/Icons/Desired Direction - Up.png'))
Thanks in advance,
Chris
Hi, @cfountain72
As far as I know, not in the standard text & image chart format.
I have some alternatives:
1 - Use Container chart or container layout available in newer versions of qlik in Qlik Dshboard bundle.
For the Container, I would add 2 text and image graphics, one for each image, and then under "Show condition", apply the condition to each image.
2 - You can choose to use the icons via Windows + period keys on Windows, for Mac I'm not sure, maybe Control + Command + Spacebar. Of course, if it suits your needs.
There is also the Favicon website https://favicon.io/ with several icons that you can use and apply to the expression, like the example below:
if(LowerIsBetterFlag = 0,'⬆️','⬇️')
See if it can be useful and maybe someone has better alternatives.
- Regards, Matheus
I tried using the Container with Show/Hide, but because I'm also using the Layout Container, you can't put a Container inside a Layout Container. My solution was to add two Text/Image Objects to the larger Layout Container, and then apply Show/Hide criteria to each one so that only one of them appears.
Thanks for your suggestions!
Hi, @cfountain72
As far as I know, not in the standard text & image chart format.
I have some alternatives:
1 - Use Container chart or container layout available in newer versions of qlik in Qlik Dshboard bundle.
For the Container, I would add 2 text and image graphics, one for each image, and then under "Show condition", apply the condition to each image.
2 - You can choose to use the icons via Windows + period keys on Windows, for Mac I'm not sure, maybe Control + Command + Spacebar. Of course, if it suits your needs.
There is also the Favicon website https://favicon.io/ with several icons that you can use and apply to the expression, like the example below:
if(LowerIsBetterFlag = 0,'⬆️','⬇️')
See if it can be useful and maybe someone has better alternatives.
- Regards, Matheus
Hi @cfountain72
The image that appears in the text and image box and the background that is set from the properties panel on the right can not easily have code injected.
You can use the styling options and the background image formula you find there to have a conditional URL:
You should be able to find the full URL for the images in your content library, by adding the /content path to the end of your usual Sense URL.
Having the whole background of the text box may not be what you are after though?
Depending on what your up and down symbols are like you may find simple text symbols (▲▼) or emoji (⬆️ ⬇️) are easier to work with?
Hope that helps,
Steve
I tried using the Container with Show/Hide, but because I'm also using the Layout Container, you can't put a Container inside a Layout Container. My solution was to add two Text/Image Objects to the larger Layout Container, and then apply Show/Hide criteria to each one so that only one of them appears.
Thanks for your suggestions!
The solution provided was to use the Container OR Layout container, so I'm glad it worked in your case.
- Matheus