Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
ranidas
Partner - Contributor III
Partner - Contributor III

Alternate Coloring in case of multiple dimensions in pivot table

Hi Team ,
Need your help in achieving below requirement. 
I have 2 dimentions : Unit and Accounts 
Categories and its respective sub categories are populated using inline load in load script.
Each unit Can contain any number of accounts (dynamic).
Each unit needs to be colored same , but accounts present inside each Unit needs to be alternatively colored . 
I am able to achieve  coloring measures by using Dimensionality , but unable to populate color for  unit and account  values section. Coloring should also reflect based on selection of respective unit.
Kindly help.PFA sreenshot

ranidas_0-1636518358123.png

 



Labels (1)
1 Solution

Accepted Solutions
vinieme12
Champion III
Champion III

try below

if(RowNo()=1,Yellow(),if(mod(RowNo(),2)<>0,LightGray()))

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.

View solution in original post

2 Replies
vinieme12
Champion III
Champion III

try below

if(RowNo()=1,Yellow(),if(mod(RowNo(),2)<>0,LightGray()))

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
ranidas
Partner - Contributor III
Partner - Contributor III
Author

Hi @vinieme12 ,
Thank You for the help , 
Your solution did worked . 
Since i have 2 dimensions , 1 w.r.t Unit and 2nd w.r.t Accounts . 
Directly applied background expression as yellow() in first dimension (Unit).
and in second(Account) dimension : if(mod(RowNo(),2)<>0,LightGray()))
For coloring Measure value, I have modified your expression as below , please correct in case of any suggestions.
If(Dimensionality()=1,RGB(240,221,184),
If(Dimensionality()=2,If(Mod(RowNo(), 2) <> 0, RGB(222,222,222),white()))).