9 Replies Latest reply: Jun 1, 2015 9:26 AM by Vinod Kumar V

# How to make line color turn red when net profit amount -ve ?

Hi All

I like to make the line chart display :-

1. When the net profit amount is -ve it shown red color line.

2. when the net profit amount is +ve it shown black color line.

Now it display whole line red color.

Paul

• ###### Re: How to make line color turn red when net profit amount -ve ?

Hi All

Enclosed my QV doc

• ###### Re: How to make line color turn red when net profit amount -ve ?

I don't see any line (its showing no data to display) and I tried clearing out any selection and still says the same.

• ###### Re: How to make line color turn red when net profit amount -ve ?

Hi,

add expression at back ground color

=if(sum[net profit]<0,red(),Black())

• ###### Re: How to make line color turn red when net profit amount -ve ?

Hi Sir

=if

(

sum([NET_PROFIT]<0,red(),Black()

)

)

I try above like what you said , but it still not work.

Paul

• ###### Re: How to make line color turn red when net profit amount -ve ?

there is a formatting error in the expression you have mentioned. You have misplaced the bracket. Please refer my expression above.

• ###### Re: How to make line color turn red when net profit amount -ve ?

Hi Paul,

I think, you have to use your expression, instead of sum([NET_PROFIT)). i.e.,

if( (sum({\$<year = {">=\$(=max(year),4)"}, month = {"<=\$(=max({<year={\$(=max(year))}>} month))"}>}NET_PROFIT/\$(Columndim89)/1000)) < 0, red(), Black())

Thanks,
Vinod Kumar V

• ###### Re: How to make line color turn red when net profit amount -ve ?

Hi Kumar

it work , thank you vey much

• ###### Re: How to make line color turn red when net profit amount -ve ?

ywc

• ###### Re: How to make line color turn red when net profit amount -ve ?

also in the qvw you have attached there is no data to display in the chart as mentioned above.

You may try using Vinod Kumar's expression at background color.