Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

question about a text object

Hi,

There's a text object in my model which has image as a background.

I have got 10 different images which can be used as a background. And I'd like to assign a certain image based on a certain condition.

For instance:

If Var=1, then use image1 as a background,

If Var=2, then use image2 as a background,

If Var=3, then use image3 as a background,

...


For some reason I don't want to create 10 different text objects and show/hide them based on a certain condition. I'd like to have a single text object with the possibility to assign different backgrounds.


Is it possible?


Thank you in advance,


Larisa

1 Solution

Accepted Solutions
parthakk
Creator II
Creator II

Hi,

PFA. This might solve your problem.

Note: Please check variable and variable triggers in document properties, under trigger tab.

Thanks,

Partha Kulkarni

View solution in original post

8 Replies
sunny_talwar

May be try something like this if its an external image we are talking about:

Pick(Var1, Image1, Image2, Image3, ... and so on)

jonathandienst
Partner - Champion III
Partner - Champion III

I don't think the background can be manipulated like that.

If you create a text box and place it behind the first (ie in a lower layer) and make the background of the first transparent, then you can use the lower box with a Representation of Image to display the 'background' image dynamically.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Anonymous
Not applicable
Author

Hi Jonathan,

But how can I make the lower box to display the background image dynamically?

As far as I see in the properties of a text-box there's a possibility to select only one image.

maxgro
MVP
MVP

I think you can't

because when you can use an expression in Qlik there is something like (...)

1.png

and for background image I don't see a way to add an expression

Maybe you can use a chart (for background image) and a text object (for text) overlapping the 2 objects.

For managing images in a chart there is an example President.qvw, usually in

C:\Program Files\QlikView\Examples\Documents

Hope someone can find a better solution.

Not applicable
Author

Hi,

Try like this.

To get images dynamically on a text object.

1. Create a variable with if condition (like if(Country='INDIA','path\Indiaflag.jpg','path\usaflag.jpg') )

2. Create a text object and give expression as =$(Vyourvariable)

    and change the representation to image in general tab.

3. Create a list box and switch between values/countries, then you can see dynamic images.

Regards,

Pavan.

parthakk
Creator II
Creator II

Hi,

PFA. This might solve your problem.

Note: Please check variable and variable triggers in document properties, under trigger tab.

Thanks,

Partha Kulkarni

Anonymous
Not applicable
Author

Hi Pavan,

That's a nice idea.

How can I load, say, 50 different images as a separate field on the backfront and assign certain titles for them?

I suppose, if I load them inside the model, I would not need to set a path like: 'path\Indiaflag.jpg'

Thank you in advance,

Larisa

Anonymous
Not applicable
Author

Thanks, everyone!