Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
quriouss
Creator III
Creator III

Load different images dependent on selections?

Is it possible to load different images depending on the selections chosen?

For example, if I click on "Mr Smith", is it possible to display an image of Mr Smith?  Or if I choose "France" can I get a French flag?

Thanks in advance,

11 Replies
Not applicable

Hi,

You have to use the "Media Box" plugin (available on QlikBranch) and use an expression like this for the URL of the images:

if(getfieldselections(FieldName)='Pierre','https://.../image1.jpg',

if(getfieldselections(FieldName)='Paul','https://.../image2.jpg',

if(getfieldselections(FieldName)='Jacques','https://.../image4.jpg',

'https://.../imageForInvalidSelection.jpg'

)))

Best regards,

Xavier.

quriouss
Creator III
Creator III
Author

Thanks.  Before I go reading the documentation, do you know if it's possible to use the selection name in the URL?

e.g. something like;  imageURL = http://image.server/[Selection_Name].jpg

Not applicable

Yes this idea is smarter than the nested if.


Try :

'http ://image.server/' & Getfieldselections(Fieldname) & '.jpg'

Not applicable

Hi Xavier,


I am very new in QlikSense and have same query regarding show an image based on selection


If I read the answer, it mention about the expression, may I know where should I put the expression and put the image also?


Thanks a lot


Best regards,

sumitjadhav
Creator II
Creator II

Hi permata,

Write the expression as Stated Below:

>>Go to the Properties of Media Box Extension.

>>and Follow the below Steps.

expression111.JPG

Thank's & Regards,

Sumit Jadhav.

Miko93
Contributor II
Contributor II

There is also a solution by using a Container-Visualisation, so without extention 😉 

mikael-c
Contributor III
Contributor III

@Miko93 , can you explain a little bit how to do it without any extension, with Container?

Thanks.

Miko93
Contributor II
Contributor II

you can use Container and insert Image&Text into each container. Based on the Filter pane you are using you can adjust the condition to show for each image. So the container is only showing selected items and therefore only selected images.
If you are interested I can show you a small example

mikael-c
Contributor III
Contributor III

I got it!

A little bit complicated when you have a lot of images (10), but it's the best solution i've found yet.

Thanks for your help!