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

Formatting text in expresssion

Hi All

I have a pivot table that looks something like...

CustomerMayApril
ASales0100
Margin050
BSales75100
Margin3550

Sales formula = Sum(sin_Sales)

GP formula = Sum(sin_GrossProfit)

What I want to do is show the zeros as a blank...

To do this, I visited the expresssion for each and keyed the following into the text colour property of the expression...

Sales .... =if(sum(sin_Sales) = 0, RGB(255,255,255))

GP........ =if(sum(sin_GrossProfit) =0, RGB(255,255,255))

What I end up with howver, is as follows...

CustomerMayApril
A100
50
BSales75100
Margin3550

i.e. If the customer has no sales in the most recent month, it blanks out the values but also blanks out the row descriptor...

Is this a bug or should I be doing something different to achieve what I want?

Thanks in advance for any help you guys can give...

Regards

Paul

17 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     You want to show nothing when value is 0, then you should set the lower limit to 0 and text color to white.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
pkelly
Specialist
Specialist
Author

I am possibly not understanding visual cues properly but beside the lower limit it states <= (please see screenshot below)...

VisualCues.jpg

I am using the Lower limit to force values below 0 to red text...

I changed the red to white and all my negative values disappeared.

Apologies if this is just my understanding...

Thanks for your help..

Paul

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

   I am here by sending you the sample

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
pkelly
Specialist
Specialist
Author

Thank you Kaushik can see what you meant now...

My understanding of visual cues is much better now as a result of this.

Thanks

Paul

gandalfgray
Specialist II
Specialist II

Hi all

Kaushiks solution will be problematic if the numbers are not integers.

An alternative solution, that will work also for decimal numbers, is to use the Text Color attribute of the Chart column:

textcolor2.JPG

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     You are right. The solution we discussed is for number's only.

     You have to decide what format your data will be in. and use the solution accordingly

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
pkelly
Specialist
Specialist
Author

Hi...

This is where I started from but have an issue with my row labels...

gandalfgray
Specialist II
Specialist II

OK, then maybe you can use the column() function:

textcolor1.JPG