Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
posywang
Creator
Creator

background color of a dimension

Hi,

I have this issue to show background color of a dimension based off value in another dimension. I have attached a sample file and hope it helps to explain my issue. The issue is that since I don't have rating in August for one project, so even it is a business only project (with value of 1 in Business column), the background color of Project doesn't get picked up and there's no highlight. Can anyone help on this case? Please feel free to ask if my statement above is not clear enough. Thank you in advance!

1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

With a straight table, you can hide a column form the presentation tab.  For a pivot table, it's a little more complicated. To hide an expression column you need to make it zero width using a one-time macro.  You'll need to know the chart id from the properties general tab and which expression column you want to change (counting from zero) so #1 in your case for the second expression.  Paste this macro code in the module editor (Ctrl-m) and press the Test button the in the editor. That's it.

Sub SetCols

SetColWidthZero "CH01"

End Sub

REM You can't set a pivot table column to zero width from the UI. Use this macro to force the widths.

REM It only needs to be run once, not onOpen

Sub SetColWidthZero (id)

    set chart = ActiveDocument.GetSheetObject(id)

set cp = chart.GetProperties

set exprs = cp.Expressions

' First expression is 0, second is 1, ...

' Set the expression# to change

Set expr = exprs.Item(1).Item(0).Data.ExpressionVisual

expr.ColWidth = 0

chart.SetProperties cp

End Sub

-Rob

http://masterssummit.com

http://qlikviewcookbook.com

View solution in original post

20 Replies
vishsaggi
Champion III
Champion III

In the presentation tab uncheck supress 0 values and see if that helps.

posywang
Creator
Creator
Author

It works but it also shows projects that I don't want to see (that has all 0s for selected months). Is there any other ways to solve the highlight issue?

vishsaggi
Champion III
Champion III

Sorry can you elaborate which rows you want to hide or exclude?

posywang
Creator
Creator
Author

I'd like to see that project A is highlighted in grey.

vishsaggi
Champion III
Champion III

Based on your qvw file i told you to uncheck supress 0 values is this not what you looking for? Can you send me a new qvw file where you having issues with?

rubenmarin

Hi Xia, changin your expression to Alt(avg(Rating),'') seems to work.

It's to assign an empty value instead of null.

posywang
Creator
Creator
Author

Hi, please check the attached QVW file. I unchecked "suppress 0" but project A still doesn't have highlight.

posywang
Creator
Creator
Author

Sorry it didn't seem to work...

rubenmarin

In attached document 'A' is highligted grey using that expression