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

color getselectedfield

Hello, i have this expression

='Chosen Customer: ' &GetFieldSelections( DimCustomer.CustomerID)

Then my text box would look like this if i choose something from customerid:

Chosen Customer: Hulla

How can i make Hulla another color ?

So chosen customer is white and hulla is green.

ps. It is in one textbox

1 Solution

Accepted Solutions
Gysbert_Wassenaar

You can't. It's not possible in a single text object. There is no way to have two different text formats or colors in one text object.


talk is cheap, supply exceeds demand

View solution in original post

9 Replies
Not applicable
Author

Hi,

I'm not sure you can do it that.

Did you try with a workaround like using two textbox with two different settings for the text color ?

Hope it helps

Giampiero

P.S: If you solve your problem please share with us your solution because it's a very interesting question.Thanks

Not applicable
Author

i can easily use two different textboxes. But i want all in one - But i havent cracked the code yet. I will let you know when i do!

marcus_sommer

Put a formula in background-color from the textbox:

if(GetFieldSelections( DimCustomer.CustomerID) = 'Hulla', green(), white())

- Marcus

Gysbert_Wassenaar

You can't. It's not possible in a single text object. There is no way to have two different text formats or colors in one text object.


talk is cheap, supply exceeds demand
vivientexier
Partner - Creator II
Partner - Creator II

Ya ! It is impossible to have different text formats in one text object... except if you...

Use the "text aera" for your customer ID and use the caption to write "Chosen Customer:". Your text aera and caption can have different fonts, size and colors. It looks nice and costs only one object .

marcus_sommer

In my case it works ...

background-color.jpg

Not applicable
Author

thats shiat But thanks for the answer

Not applicable
Author

No does not work It colors the whole field, and not only the selection

marcus_sommer

You want a textbox which looks like a listbox?

Perhaps a possibility is to use a pivot like this and set (optional) the column-width on 0

set chart = ActiveDocument.GetSheetObject("CH10007")

chart.SetPixWidth 2 , 0

background-color2.jpg

Another possibility could be the textbox-extension from Stefan Walter - see:

http://www.qlikblog.at/1579/qliktip-39-displaying-html-content-minimalistic-htmltextbox-object-exten...

- Marcus