Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

sofiavaz
Contributor

Color a Master dimension used in a bar chart

Hi all,

I'm using the master dimension below as one of my bar chart' dimensions (the other one is a time dimension). Does anyone knows how can personalize the bars' color?

=if(AllocTransfOrigContribEurTon>AllocTransfDestContribEurTon, 'DOWNGRADE',

    IF((AllocTransfDestBusinessTp='OPPORTUNIT' and AllocTransfOrigBusinessTp<>'OPPORTUNIT') OR (AllocTransfDestBusinessTp<>'OPPORTUNIT' and AllocTransfOrigBusinessTp='OPPORTUNIT'), 'OPPORTUNITY TYPE',

        IF(AllocTransfOrigMillCd<>AllocTransfDestMillCd, 'DIFFERENT MILL',

        'OK')))

Thank you!!

5 Replies
adityaakshaya
Contributor III

Re: Color a Master dimension used in a bar chart

Hi Sofia,

As per my understanding, you have two dimension and you want to fix the color for the calculated dimension mentioned in the statement.

Please go to the chart expression, expand the expression and under background color just add below code. Here I have change Downgrade = Red; Opportunity Type = Green;Different Mill = Blue;Ok = Yellow.

Hope this help you.

Regards.

=if(AllocTransfOrigContribEurTon>AllocTransfDestContribEurTon, RGB(255,0,0),

    IF((AllocTransfDestBusinessTp='OPPORTUNIT' and AllocTransfOrigBusinessTp<>'OPPORTUNIT') OR (AllocTransfDestBusinessTp<>'OPPORTUNIT' and AllocTransfOrigBusinessTp='OPPORTUNIT'), RGB(0,255,0),

        IF(AllocTransfOrigMillCd<>AllocTransfDestMillCd, RGB(0,0,255),

        RGB(255,0,255))))

Digvijay_Singh
Honored Contributor III

Re: Color a Master dimension used in a bar chart

You may try something like this -

Capture.PNG

ogster1974
Honored Contributor II

Re: Color a Master dimension used in a bar chart

If you are using qlik Sense from sept version

onwards you have the ability to custom colour your master dimensions or measures.

Then when applying in your chart set library colours to on.

I would do this.

sofiavaz
Contributor

Re: Color a Master dimension used in a bar chart

Thank you Andy. Unfortunately i'm using a previous version...

sofiavaz
Contributor

Re: Color a Master dimension used in a bar chart

Hi Akshaya, thanks for your help.

I've tried adding this expressions under the chart' "color and legend" tab but it didn't work... I'm not sure if that's where you mean when you say "expand the expression and under background". Is it?

Thank you!

Community Browser