Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
iliyansomlev
Partner - Creator II
Partner - Creator II

Dimension background color in a pivot table (QV 11.2 SR 5)

Please see the attached example. I want to show Saturdays in light gray and Sundays in gray but it doesn't work. Could you tell me where I make mistake? Thanks!

1 Solution

Accepted Solutions
agilos_mla
Partner - Creator III
Partner - Creator III

You need to compute the day for the entire column otherwise the pivot will only set color where numbers <> 0 or null.

Use this expression in the background expression (not the dimension background!)  (daynum for Monday is 0 in QV)

 

= if(max(total <DateUse> WeekDay(DateUse))=6,rgb(200,200,200),
if(max(total <DateUse> WeekDay(DateUse))=5,rgb(240,240,240)) )


Michael

background.bmp

View solution in original post

15 Replies
Anonymous
Not applicable

Lliyan

Try this for the background colour on your Dimension.

     =if(WeekDay='Sun',rgb(200,200,200),if(WeekDay='Sat',rgb(240,240,240)) )

Best Regards,     Bill

iliyansomlev
Partner - Creator II
Partner - Creator II
Author

I have tried, it doesn't work

Clever_Anjos
Employee
Employee

Use this expression as Background color for your Dimension

=if(WeekDay(DateUse)='Sun',rgb(200,200,200),if(WeekDay(DateUse)='Sat',rgb(240,240,240)))

Aurelien_Martinez
Partner - Specialist II
Partner - Specialist II

Hi,

You can use this expression for your background color :

=pick(Match(WeekDay(DateUse), 'Sun', 'Sat'), rgb(200,200,200), rgb(240,240,240))

Best,

Aurélien

Help users find answers! Don't forget to mark a solution that worked for you!
Not applicable

Did you try with colour functions Light Gray & Dark Gray (using these in IF condition where condition checks value of your dimension)?

iliyansomlev
Partner - Creator II
Partner - Creator II
Author

the expressions all of you mention don't work, I have tried them and also aggr and others. I don't know what is the problem

Aurelien_Martinez
Partner - Specialist II
Partner - Specialist II

Ok, remove your calculed dimension and use DateUse

Help users find answers! Don't forget to mark a solution that worked for you!
iliyansomlev
Partner - Creator II
Partner - Creator II
Author

it's the same result - not working; only when Weekday is added as dimension this fixes the background color of DateUse, but I don't want to add additional dimesnion (cannot make labels vertical then) and I don't understand why background color doesn't work when it is one-to-one unique relationship (DateUse to WeekDay)

Anonymous
Not applicable

Lliyan

Is the attached what you are after ?

Best Regards,    Bill