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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

how to change picture based on selection

we have company logo showing in a QVW,  want the logo changes when users picks different company. how can this be done in QV.

thanks

1 Solution

Accepted Solutions
johnca
Specialist
Specialist

Hi Zou,

Load the logo images using the following code as an example. In this example the logos are named Logo1.png, Logo2.png, etc...and are located on my C drive in afolder named "Logos".

Logos:

Bundle Info Load * Inline [

     Logo, Image

     Logo1, 'C:\Logos\Logo1.png'

     Logo2, 'C:\Logos\Logo2.png'

     Logo3, 'C:\Logos\Logo3.png'

     Logo4, 'C:\Logos\Logo4.png'

...add as many as you need here...

     ];

Reload your document. This will bring the logos in to your document for use in the procedure below.

Create a Text object and in the Text expression area find your loaded images using the Image tab. Select Image folder "Logo" (as defined in the load script above) and then select one of the logos.

Next, while still in the text object dialog go to the Layout tab and set the Show >> Conditional to <your company name field> = 'company 1' so that this text object only shows when you select that company.

Repeat the text object for as many companies you have, making sure each one conditional shows only if the company name field matches what is selected.

With this method if no company is selected nothing will show.

--john

View solution in original post

5 Replies
Not applicable
Author

Take advantage of conditional shows and variables.  I attached a sample demo to give you an idea of what I mean

maxgro
MVP
MVP

in your qlikview installation folder (C:\Program Files\QlikView\Examples\Documents) there is a qlikview app

Presidents.qvw

In the last tab, Photo, there is an example of changing thr image based on user selection

johnca
Specialist
Specialist

Hi Zou,

Load the logo images using the following code as an example. In this example the logos are named Logo1.png, Logo2.png, etc...and are located on my C drive in afolder named "Logos".

Logos:

Bundle Info Load * Inline [

     Logo, Image

     Logo1, 'C:\Logos\Logo1.png'

     Logo2, 'C:\Logos\Logo2.png'

     Logo3, 'C:\Logos\Logo3.png'

     Logo4, 'C:\Logos\Logo4.png'

...add as many as you need here...

     ];

Reload your document. This will bring the logos in to your document for use in the procedure below.

Create a Text object and in the Text expression area find your loaded images using the Image tab. Select Image folder "Logo" (as defined in the load script above) and then select one of the logos.

Next, while still in the text object dialog go to the Layout tab and set the Show >> Conditional to <your company name field> = 'company 1' so that this text object only shows when you select that company.

Repeat the text object for as many companies you have, making sure each one conditional shows only if the company name field matches what is selected.

With this method if no company is selected nothing will show.

--john

Not applicable
Author

Thanks all the help!! one more

could conditional show work with Bookmark? we've create a book mark for company and other selection criteria, ideally when user click the bookmark, logo changes

johnca
Specialist
Specialist

Yes, it should, as long as the bookmark selects 1 company.

Also, depending on your specific needs, please select the above response that best answers your question and mark it as Right Answer. Also, you can mark others as Helpful Answers. This allows others to find solutions to their problems.