# Qlik Sense App Development

Valued Contributor II

## How to make Bar with -ve value color change to RED ?

Hi All,

I have a chart which have +ve and -ve value , I like to make -ve value bar color change to RED.

Paul

1 Solution

Accepted Solutions
Valued Contributor II

## Re: How to make Bar with -ve value color change to RED ?

Hi Chanty

Thank you for your expression below :-

If(SOURCE>0,red())

I try and found not work , suddenly i recall i have did it in QV , and i copy the script from background color expression below and it work fine :-

if(

money(

Sum({\$<year = {\$(=Max(year)-0)}, month = {"<=\$(=Max({<year={\$(=Max(year))}, sales = {'*'}>} month))"}>}profit_amt/1000)

, \$(vMoneyFormatK))

-

money(

Sum({\$<year = {\$(=Max(year)-0)}, month = {"<=\$(=Max({<year={\$(=Max(year))}, sales = {'*'}>} month))"}>}Exp/1000)

, \$(vMoneyFormatK))

>0, Green(), Red())

4 Replies
Valued Contributor II

## Re: How to make Bar with -ve value color change to RED ?

Enclosed my QS Doc

Esteemed Contributor III

## Re: How to make Bar with -ve value color change to RED ?

chk attached

Valued Contributor II

## Re: How to make Bar with -ve value color change to RED ?

Hi Chanty

Thank you for your expression below :-

If(SOURCE>0,red())

I try and found not work , suddenly i recall i have did it in QV , and i copy the script from background color expression below and it work fine :-

if(

money(

Sum({\$<year = {\$(=Max(year)-0)}, month = {"<=\$(=Max({<year={\$(=Max(year))}, sales = {'*'}>} month))"}>}profit_amt/1000)

, \$(vMoneyFormatK))

-

money(

Sum({\$<year = {\$(=Max(year)-0)}, month = {"<=\$(=Max({<year={\$(=Max(year))}, sales = {'*'}>} month))"}>}Exp/1000)

, \$(vMoneyFormatK))

>0, Green(), Red())

Esteemed Contributor III

## Re: How to make Bar with -ve value color change to RED ?

yeah/.......i saw ur selected in ur filter as Source  so i hve given  that expression