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: 
Aspiring_Developer
Creator III
Creator III

Assigning colors to dimension created using value list

Hello All,

I created  pie chart using value list dimensions.

Dimensions:-=valuelist('Unlimited Contracts N-1','Fixed Term Contracts N-1','Total Temps N-1')

Right now the colors of the dimensions are coming automatically as i have opted Colors Auto in Qliksense

Aspiring_Developer_0-1601965672694.png

 I want to assign same colors to the dimensions like below:

Unlimited Contract N-1 = Blue 

Fixed term Contract N-1= Red

Total Temps N-1= Green

I tried to make assign the colors in measures like below but it did not worked .

=if( valuelist('Unlimited Contracts N-1','Fixed Term Contracts N-1','Total Temps N-1')='Unlimited Contracts N-1',

num(sum({<Indicateur.Code = {'PO.1.131b'},[Site.isYFPO]={'$(vChange)'},[Site.Participe]={'49|50'},Date.Year = , Date.MonthName = , Date.Quarter =, Date.Month =, Date.MonthEnd =, MonthYear=,Date=,NewTestvb1=,Addmonths_Date={'$(= Date(addmonths(MonthStart(max(Addmonths_Date)),-11),'DD/MM/YYYY'))'} >} [Indicateur.Value])

/

sum({<Indicateur.Code = {'PO.1.137b'},[Site.isYFPO]={'$(vChange)'},[Site.Participe]={'49|50'},Date.Year = , Date.MonthName = , Date.Quarter =, Date.Month =, Date.MonthEnd =, MonthYear=,Date=,NewTestvb1=,Addmonths_Date={'$(= Date(addmonths(MonthStart(max(Addmonths_Date)),-11),'DD/MM/YYYY'))'} >} [Indicateur.Value])

,'###.#%', blue())

 

Can anyone please help me on this as i am not able to find anything on community ??

@Kushal_Chawda 

Labels (2)
1 Solution

Accepted Solutions
Kushal_Chawda

@Aspiring_Developer  Go to chart properties->Appearance-> Colors and legend> from dropdown select "By expression" and put below expression

=Pick(match(
valuelist('Unlimited Contracts N-1','Fixed Term Contracts N-1','Total Temps N-1'),
'Unlimited Contracts N-1','Fixed Term Contracts N-1','Total Temps N-1'),
RGB(...),RGB(...),RGB(...))

 

Similarly you can apply colors to other chart

View solution in original post

10 Replies
avinashelite

Instead of creating the value list why don't you create an Inline load and try defining the color !! that would definitely work rite   

Usama
Creator
Creator

Hi,
Select the 'color by expression' option in Color section and try following expression:
If('Unlimited Contract N-1'=Blue(),
 If('Fixed term Contract N-1'=Red(),
If('Total Temps N-1'=Green(),white()))
)

Thanks,
Usama

From Nothing - To Something - To Everything
Aspiring_Developer
Creator III
Creator III
Author

I tried , it didn't worked

Aspiring_Developer_0-1601972303489.png

 

Aspiring_Developer
Creator III
Creator III
Author

I am using show and hide container to show multiple views of the report. Could you explain more briefly please

Kushal_Chawda

@Aspiring_Developer  What is the condition of giving color?

Aspiring_Developer
Creator III
Creator III
Author

there is no such specific condition. I am using the value list  dimensions in multiple charts and they all are showcase in same screen , i want to define same colors for all the dimension in all charts . Please see below view:-

=valuelist('Unlimited Contracts','Fixed term Contracts','Total Temps')-Dimension of first chart

==valuelist('Unlimited Contracts N-1','Fixed Term Contracts N-1','Total Temps N-1')- Dimension for second chart

 

Aspiring_Developer_0-1601979570643.png

Now, I want to achieve below:-

Unlimited Contracts & Unlimited Contracts N-1= Should have the same color in both charts (Any color may be blue)

Fixed term Contracts & Fixed term Contracts N-1= Should have same color in both charts (Any color may be red)

Total Temps & Total Temps N-1== Should have same color in both charts (Any color may be Green)

 

I am not able to understand , how can we assign colors when we use value list for dimensions and measures.

Please help.

Kushal_Chawda

@Aspiring_Developer  Go to chart properties->Appearance-> Colors and legend> from dropdown select "By expression" and put below expression

=Pick(match(
valuelist('Unlimited Contracts N-1','Fixed Term Contracts N-1','Total Temps N-1'),
'Unlimited Contracts N-1','Fixed Term Contracts N-1','Total Temps N-1'),
RGB(...),RGB(...),RGB(...))

 

Similarly you can apply colors to other chart

Aspiring_Developer
Creator III
Creator III
Author

Hello Kush,

I tried below in the  :-

Color code expression :-

=Pick(match(valuelist('Unlimited Contracts','Fixed term Contracts','Total Temps'), Blue(), red(), Green() ))

It is giving me below output:-

Aspiring_Developer_0-1601989052590.png

It is not working, please suggest

 

Aspiring_Developer
Creator III
Creator III
Author

Also for the chart i am using this expression:-

if(Valuelist('Unlimited Contracts','Fixed term Contracts','Total Temps')='Unlimited Contracts',

num(sum({$<Indicateur.Code = {'PO.1.2'},Date=,Date.MonthEnd=,NewTestvb1=,Date.Year = , Date.MonthName = , Date.Quarter =, Date.Month =, Date= {"$(=MonthStart(Max(Date)))"}, Site.Participe = {'49|50'},[Site.isYFPO]={'$(vChange)'}>} Indicateur.Value)
/
sum({$<Indicateur.Code = {'PO.1.7'},Date=,Date.MonthEnd=,NewTestvb1=,Date.Year = , Date.MonthName = , Date.Quarter =, Date.Month =, Date= {"$(=MonthStart(Max(Date)))"}, Site.Participe = {'49|50'},[Site.isYFPO]={'$(vChange)'}>} Indicateur.Value)

,'###.#%' )

,

if(ValueList('Unlimited Contracts','Fixed term Contracts','Total Temps')='Fixed term Contracts',
num(sum({$<Indicateur.Code = {'PO.1.5'},Date=,Date.MonthEnd=,NewTestvb1=,Date.Year = , Date.MonthName = , Date.Quarter =, Date.Month =, Date= {"$(=MonthStart(Max(Date)))"}, Site.Participe = {'49|50'},[Site.isYFPO]={'$(vChange)'}>} Indicateur.Value)
/
sum({$<Indicateur.Code = {'PO.1.7'},Date=,Date.MonthEnd=,NewTestvb1=,Date.Year = , Date.MonthName = , Date.Quarter =, Date.Month =, Date= {"$(=MonthStart(Max(Date)))"}, Site.Participe = {'49|50'},[Site.isYFPO]={'$(vChange)'}>} Indicateur.Value)

,'###.#%')

,

if(Valuelist('Unlimited Contracts','Fixed term Contracts','Total Temps')='Total Temps',

Num(sum({$<Indicateur.Code = {'PO.1.3'},Date=,Date.MonthEnd=,NewTestvb1=,Date.Year = , Date.MonthName = , Date.Quarter =, Date.Month =, Date= {"$(=MonthStart(Max(Date)))"}, Site.Participe = {'49|50'},[Site.isYFPO]={'$(vChange)'}>} Indicateur.Value)

/

sum({$<Indicateur.Code = {'PO.1.7'},Date=,Date.MonthEnd=,NewTestvb1=,Date.Year = , Date.MonthName = , Date.Quarter =, Date.Month =, Date= {"$(=MonthStart(Max(Date)))"}, Site.Participe = {'49|50'},[Site.isYFPO]={'$(vChange)'}>} Indicateur.Value)

,'###.#%' ) )

 


)

)