Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable

Color difference in Bar Chart after applying ColorMix

Hello All,

I wanted to have customized colors for different campaigns, So i applied expressions to get that in Colors and Legend section by removing auto. After applying different colors for bars even though i'm getting color differences for different campaigns, there is slightly color difference when it comes to second dimension.

My goal is to maintain the same color in all the dimensions i have used.

Attached below for a reference

img1.png

From the above attached figure:

For the Camp4/18-4/30 we have same color code in both A and B, but if we look at C, D, E those looks different.

Formula i used in colors and legend:

ColorMix2( (rank(New_Campaign_Name)/(noofrows(TOTAL)/6))-1 ,rgb(0,112,200),rgb(142,180,227),rgb(198,217,241))

Dimension:New_Campaign_Name

Measure:sum(Sum)

In data load editor:

LOAD

`client_id`,

`client_name`,

  `batch_name`,

`batch_meta_data_id`,

`campaign_id`,

`start_date`,

`campaign_name`,

expiration_date,

expFlag,        

If(SubStringCount(batch_name,'CRF') and SubStringCount(batch_name,'LPC'),'CRF & LPC',if(wildmatch(batch_name,'*CRF'),'CRF',If(SubField(campaign_name, '_', 1) = 'Existing','Existing',if(SubField(campaign_name, '_', 1) = 'New','New',batch_name))))  as Segment_Name,

'Camp' & Replace(Left(RIGHT(campaign_name, 21),5), '-', '/') & ' - ' & Replace(Left(RIGHT(campaign_name, 10),5), '-', '/')

As New_Campaign_Name

Resident CustomCampaignTable  Order by  batch_meta_data_id, campaign_id  desc;

Drop Table CustomCampaignTable;

Another graph which i'm getting correct color code is:

img2.png

DimensionSmiley Frustratedegment_Name

Measure:sum(Sum)

Same data load editor as given above.

Waiting for your valuable replies,,,

Best Regards

7 Replies
arulsettu
Honored Contributor III

Re: Color difference in Bar Chart after applying ColorMix

Not applicable

Re: Color difference in Bar Chart after applying ColorMix

Thanks for that,

But here i have dynamic measures,,in that sample they have used static measures.

Not applicable

Re: Color difference in Bar Chart after applying ColorMix

Qvf file attached

Not applicable

Re: Color difference in Bar Chart after applying ColorMix

omarbensalem

Hello Bro,,,Can you help me on this

OmarBenSalem
Esteemed Contributor

Re: Color difference in Bar Chart after applying ColorMix

You want to color by New_compaign_name?

I did not really understand your goal sorry

But, If you want each compaign, to have a unique color in all the Types; you should simply color by Dimension :

Capture.PNG

Capture.PNG

Capture.PNG

Not applicable

Re: Color difference in Bar Chart after applying ColorMix

Yea i can do it from color by dimension,,but i should customize it, i think that is possible only with expression.

Also i have this link which solves my problem only if i have static dimensions.

Qlik Sense: How to set custom colors by measure in a bar chart

Not applicable

Re: Color difference in Bar Chart after applying ColorMix

img1.png

A and B looks fine because they have same color code for camp4/18-4/30, But for C,D,F it doesn't work, even after applying expression in color by expression:

ColorMix2( (rank(New_Campaign_Name)/(noofrows(TOTAL)/6))-1 ,rgb(0,112,200),rgb(142,180,227),rgb(198,217,241))

Community Browser