Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
cfountain72
Creator II
Creator II

Conditional Images

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

Labels (2)
2 Solutions

Accepted Solutions
MatheusC
Specialist II
Specialist II

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.

MatheusC_0-1729775845107.png

 

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

Did you find a solution to your question? Mark the solution as accepted and if you found it useful, press the like button!

View solution in original post

cfountain72
Creator II
Creator II
Author

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!

View solution in original post

4 Replies
MatheusC
Specialist II
Specialist II

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.

MatheusC_0-1729775845107.png

 

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

Did you find a solution to your question? Mark the solution as accepted and if you found it useful, press the like button!
stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

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:

stevedark_0-1729776217213.png

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

cfountain72
Creator II
Creator II
Author

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!

MatheusC
Specialist II
Specialist II

MatheusC_0-1729790401802.png



The solution provided was to use the Container OR Layout container, so I'm glad it worked in your case.

- Matheus

Did you find a solution to your question? Mark the solution as accepted and if you found it useful, press the like button!