Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
keithericparsons77
Contributor II
Contributor II

Image based on IF

In my Qlik Sense app, I am using "Media box" and an IF formula to display an image from my Image Library.  If "Components" is selected the image displayed is gears, if "Engines" is selected the image is an Engine....and so on...

Here's what I have written so far:

if([DIVISION]='Components', 'https://www.website.com/appcontent/gears.png',

if([DIVISION]='Engines', 'https://www.website.com/appcontent/ENGINE.jpg',

if([DIVISION]='Fixed Wing', 'https://www.website.com/appcontent/FIXEDWING.png',

if([DIVISION]='Industrial Processes', 'https://www.website.com/appcontent/industrialprocesses.jpg',

if([DIVISION]='Rotary Wing', 'https://www.website.com/appcontent/ROTARYWING.png','' ))))) as [IMAGE]

 

What I am trying to do is add an additional image(representing "ALL") to my Image Library and have a Formula that requests that image if Components, Engines, Fixed Wing, Industrial Processes, and Rotary Wing are ALL SELECTED.

 

1 Solution

Accepted Solutions
keithericparsons77
Contributor II
Contributor II
Author

I walked away, grabbed a coffee, and came back to try again.  This worked!  Much appreciated!

View solution in original post

7 Replies
JordyWegman
Partner - Master
Partner - Master

Hi Keitheric,

You can use GetSelectedCount() and see if all are selected. If this is the case, point towards the 'ALL' image.

Jordy

Climber

Work smarter, not harder
keithericparsons77
Contributor II
Contributor II
Author

Thanks Jordy,

But, no luck.  When I try to add GetSelectedCount() to my  formula in the Data Load Editor,  it doesn't work (or even identify GetSelectCount as a command).

for individual selections, this works, and looks good.  But to finish this off, I really need to get the "All" divisions to populate an image 😞

JordyWegman
Partner - Master
Partner - Master

Ah, I thought you were doing this in the front-end... GetSelectedCount() isn't going to work in the back-end.

Could you maybe show an image of what you want to achieve?

Jordy

Climber

Work smarter, not harder
keithericparsons77
Contributor II
Contributor II
Author

I am trying to get the "All" image to populate when all of the DIVISIONS are selected.

This is my data load editor screen as well as what I see when I select each DIVISION.

I created an image meaning "all", and I have tried to determine a solution to get it to display "All" when all of the DIVISIONS are selected, but no luck.  Any help would be appreciated. 

for qlik help.jpg

 My images are in my Image Library, and i copied the link to the file.

coding11.jpg

 I'm using Media Box extension.

coding.jpg

JordyWegman
Partner - Master
Partner - Master

I don't think this is going to work this way. You will need to create another image, that contains all these images in one image.

Then in the front-end you need to create a formula that says:

IF( GetSelectedCount( Division ) = 6 ,
    TotalImage,
    Image
)

Jordy

Climber

Work smarter, not harder
keithericparsons77
Contributor II
Contributor II
Author

Below is an image of Media Box.  If I change the front end to the formula from your last post, I will lose the link to my other 5 images.  (=IMAGES).

MEDIA BOX.jpg

 If you can think of a different way for me to accomplish this, i will change course!  Open to suggestions!

keithericparsons77
Contributor II
Contributor II
Author

I walked away, grabbed a coffee, and came back to try again.  This worked!  Much appreciated!