Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
sarfaraz_sheikh
Contributor III
Contributor III

Color only desired character in string

Dear All,

I have below string and i want to do the first character in red color and rest of all in blue color.

For example

String   :   'ATotal_Leads_Considered'

I want first character in red color and  rest of all in blue color like below :-

A_Total_Leads_Considered

Can anyone help me with this ..i.e how i can achieve the same ...

Sarfaraz

3 Replies
Peter_Cammaert
Partner - Champion III
Partner - Champion III

A string where?

If it's just a text box string, create two text boxes, one with a red capital initial character, and another with the remainder of the string. Position them close together to make them appear as a single string.

Labels have no solution for this problem, as any input field forces you to set a font, size and color for the entire text string (or expression result).

sarfaraz_sheikh
Contributor III
Contributor III
Author

Thanks for your reply peter ....However i have one dimension called MTDChannelDescription that contains the values like below

A_Total_Leads_Considerd

B_Insurer_Reject

C_Follow_Up 

like this but i want to color String in diffrent color . is this possible

If yes ..can you keep any example here for my understanding ..

Sarfaraz

Peter_Cammaert
Partner - Champion III
Partner - Champion III

No, not possible with one single dimension value.

You can try creating Calculated Dimensions: one has the left part, another has the right part, like in:

=left(MTDChannelDescription, 2)

=mid(MTDChannelDescription, 3)

If you display them in a straight table and next to each other, you can wipe out the cell border (I imagine), right align & color red the left part, and left align and color blue the right part.

You'll have to experiment a bit to find out whether this suits your needs.

Peter