Skip to main content
Announcements
Jan 15, Trends 2025! Get expert guidance to thrive post-AI with After AI: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
laacib
Contributor III
Contributor III

Show image according to selected field values

I want to show an image direct on an empty area of a sheet or in the backgroud of a diagramm based on a selected field values. Could someone please provide an example how and where such a formule is to set? For example when I select a name of a logo, the image of that logo shoud be visible on a certain area of the sheet or on a diagramm background where the formule expression was predefined. Thanks in advance.

I am looking for something like this which is not working as expected when  paste it in expression area:

= if(GetFieldSelections(logo_field)='logo 1', 'https://....logo1.jpg',
   if(GetFieldSelections(logo_field)='logo 2', 'https://....logo2.jpg'
   ))
  
1 Solution

Accepted Solutions
laacib
Contributor III
Contributor III
Author

A picture can be inserted inside of a table with one column only that should be stretched according the image. The formulre can pasted in the expression editor for that particular field. Here an example:

Define some variables first with:

images_pre_path = 'https://yourqliksense-domain.eu.qlikcloud.com/api/v1/apps/'

images_post_path = '/media/files/'

app_id = DocumentName()

images_path = images_pre_path & app_id & images_post_path

 

And then in the expression editor for the filed of the table object:

= if(GetFieldSelections(logo_field)='logo 1', images_path & GetFieldSelections(logo_field) & '.png', images_path & 'Default.png')

While preparing/uplouding images with same names as the value of the selected field values.

 

 

 

View solution in original post

2 Replies
MartW
Partner - Specialist
Partner - Specialist

I don't think this is possible within 1 object in Qlik.

what you can do is create the same object 2 times 1 time with logo1 as a background and 1 time as a logo2 background.

after that drag both the object into a container object. then add a show condition to both the object and you got what you need.

laacib
Contributor III
Contributor III
Author

A picture can be inserted inside of a table with one column only that should be stretched according the image. The formulre can pasted in the expression editor for that particular field. Here an example:

Define some variables first with:

images_pre_path = 'https://yourqliksense-domain.eu.qlikcloud.com/api/v1/apps/'

images_post_path = '/media/files/'

app_id = DocumentName()

images_path = images_pre_path & app_id & images_post_path

 

And then in the expression editor for the filed of the table object:

= if(GetFieldSelections(logo_field)='logo 1', images_path & GetFieldSelections(logo_field) & '.png', images_path & 'Default.png')

While preparing/uplouding images with same names as the value of the selected field values.