Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

pivot: secondarydimensionality, rowno() and colors on total column

I've got a problem with the color of columns' caption: I'd like for it to stay black, but it gets the color of the first value below it.

I'm attaching a picture and a document showing the issue.

error loading image


1 Solution

Accepted Solutions
matt_crowther
Luminary Alumni
Luminary Alumni

Always the way; as soon as you suggest a Cowboy solution a practical one comes to mind.

Attached is the solution. I've come at it from the other angle (the Native American method!?); all values are coloured using Visual Cues as this DOESN'T colour the header, I've then over riden the cue in the body by using the Text Colour expression to colour values back to black where the columnno()<>0.

Seems to work in my sample and no Cowboy tactics.

Hope that helps.

Matt - Visual Analytics Ltd

View solution in original post

7 Replies
Not applicable
Author

Hi

You can use Visual Cues for text color.

Anders

Not applicable
Author

"Visual cues" will color every column; I tried putting some expressions into it but couldn't avoid coloring every column.

Only the "difference" column should be colored, this is why I took the expression->"Text color" route.

matt_crowther
Luminary Alumni
Luminary Alumni

Hopefully this will provide a nice solution as I've used it in a similar situation.

This isn't the full solution but it will give you the principals you need: in the 'Text Color' expression box of the relevant expression use the formula:

=if(rowno()=0 or columnno()=0,rgb(0,0,0))

This forces sub-totals and totals to be shown in black text.

This will override any other colour formats impossed on the chart; by Visual Cues or otherwise. If you need a more nuanced solution add the above formula into a wider if statement controling the Text Colour of the relevant expression.

Hope that helps,

Matt - Visual Analytics Ltd

Not applicable
Author

I'm afraid I didn't explain myself.

The only problem in the image and doc I posted is the fact that the string "Amount" gets colored in red/green while I want it to be always black, everything else is already OK.

I'd like for the values in the "difference" column to be colored, only them, not the ones in the other columns.

I don't want the caption of the "difference" column, "Amount", to be colored: THIS IS MY PROBLEM.

I cannot use "visual cues" because all the columns would get colored, while I want only the column with the differences/totals to be colored. I tried using secondarydimensionality() in the "visual cues" expression to no avail.

Using rowno()=0 in "Text Color" has no effect because rowno() returns 1 for the "Amount" caption row, MAYBE THIS IS A BUG?

Using columnno()=0 in "Text Color" will cause the entire "difference" column to be black, which is not what I want.

Thanks!

matt_crowther
Luminary Alumni
Luminary Alumni

I understand. It feels like there should be a solution as it's a problem that I've experienced too and having a column heading coloured for no reason is frankly ridiculous.

Cowboy solution; take a screen print > copy the 'Amount' header section of the print and save it as an image > create a text object with the image as a background and line up over the top - Yee Haw!!

If you're deploying to end users you can lock the movement of objects down so it shouldn't be an issue...otherwise it's probably not suitable.

I'd recommend raising it as a bug / feature request.

All the best partner!

Matt - Visual Analytics Ltd

matt_crowther
Luminary Alumni
Luminary Alumni

Always the way; as soon as you suggest a Cowboy solution a practical one comes to mind.

Attached is the solution. I've come at it from the other angle (the Native American method!?); all values are coloured using Visual Cues as this DOESN'T colour the header, I've then over riden the cue in the body by using the Text Colour expression to colour values back to black where the columnno()<>0.

Seems to work in my sample and no Cowboy tactics.

Hope that helps.

Matt - Visual Analytics Ltd

Not applicable
Author

That's perfect!

Thanks!