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: 
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

Dimension:Segment_Name

Measure:sum(Sum)

Same data load editor as given above.

Waiting for your valuable replies,,,

Best Regards

7 Replies
arulsettu
Master III
Master III

Not applicable
Author

Thanks for that,

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

Not applicable
Author

Qvf file attached

Not applicable
Author

omarbensalem

Hello Bro,,,Can you help me on this

OmarBenSalem

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
Author

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
Author

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))