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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Text colour first character

Hi Guys,

I have a straight table that has a field called [Rejection Reasons], in some instances the results in this field are only ',' or a correct reason , but preceeded by a comma.

I dont want to see the first comma in the chart,

In the demension I have gone into [Text colour] and put in the following :

if([Rejection Reasons]=',',RGB(255,255,255))

That works for the ones that are only a comma, I then tried variations of to look for the ones that start with the comma , but they were changing all the text white ,

if ( left ([Rejection Reasons],1)=',',RGB(255,255,255)))

Can anyone help, I am looking to change comma text white when there in ONLY a comma OR when the statemnt starts with a comma

Thanks a mill

Anne

Labels (1)
1 Solution

Accepted Solutions
swuehl
Champion III
Champion III

I believe the format codes are affecting the complete string, you can't format single characters / substrings.

Why not just remove the first character in your expression?

=mid([Rejection Reasons],2)

View solution in original post

5 Replies
Anonymous
Not applicable
Author

Hi,

Try:

=if([Rejection Reasons] like ',*' ,RGB(255,255,255))

Kind Regards

Razak

Not applicable
Author

Hello Anne,

can also be - =If(Mid([Rejection Reasons],1,1)=',',RGB(255,255,255))

Regards

Stive

Brasil

Not applicable
Author

Thanks Guys

They both work if I wish to change all the text White

I actually am lookting to just change the first character white so --

If ( The first character =',', then make the first character RGB(255,255,255), RGB(0,0,0))

Any ideaas how this could be donw,

I mean I could trim it on Load in the script but I would rather just change it within the chart

Any advice appreciated

Thanks

swuehl
Champion III
Champion III

I believe the format codes are affecting the complete string, you can't format single characters / substrings.

Why not just remove the first character in your expression?

=mid([Rejection Reasons],2)

Not applicable
Author

Swuehl,

Thanks I sometimes miss the obvious,

So simple and it works perfectly

Thanks