Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable

Bar chart colors apply based on the expression

first expression should get blue and second expression some other colors.

I have written some expression here. but, for both the bars I am getting same color.


Can any one suggest me on this problem?

if(NumOfFailures=0,

        if((Sum({<CalendarMonth={'$(vMaxMonthYear)'},EquipmentCategory ={'Locomotive'}>}AssetMiles)

        /

        Sum({<CalendarMonth={'$(vPrevMonthYear)'},EquipmentCategory ={'Locomotive'}>}NumOfFailures))>0,

        RGB(35, 164, 145),

        if((Sum({<CalendarMonth={'$(vMaxMonthYear)'},EquipmentCategory ={'Locomotive'}>}AssetMiles)

        /

        Sum({<CalendarMonth={'$(vMaxMonthYear)'},EquipmentCategory ={'Locomotive'}>}NumOfFailures))>0,

        RGB(35, 164, 145),

        RGB(35, 164, 145)

        )

        )

        ,

        if((Sum({<CalendarMonth={'$(vPrevMonthYear)'},EquipmentCategory ={'Locomotive'}>}AssetMiles)

        /

        Sum({<CalendarMonth={'$(vPrevofPrevMonth)'},EquipmentCategory ={'Locomotive'}>}NumOfFailures))>0,

  RGB(14, 49, 146),

        if((Sum({<CalendarMonth={'$(vPrevMonthYear)'},EquipmentCategory ={'Locomotive'}>}AssetMiles)

        /

        Sum({<CalendarMonth={'$(vPrevMonthYear)'},EquipmentCategory ={'Locomotive'}>}NumOfFailures))>0,

        RGB(14, 49, 146),

        RGB(14, 49, 146)

      

        ))

)

2 Replies
balabhaskarqlik
Honored Contributor

Re: Bar chart colors apply based on the expression

It's better to apply the color format from: Background Color option of the Expression.

mato32188
Contributor III

Re: Bar chart colors apply based on the expression

Hi kumarsuresh lulu,

could you please at least make a screenshot of your bar chart?

Thanks


BR

Martin