Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
paulyeo11
Master
Master

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

1 Solution

Accepted Solutions
Not applicable

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

View solution in original post

9 Replies
paulyeo11
Master
Master
Author

Hi All

Enclosed my QV doc

ankit777
Specialist
Specialist

Hi,

add expression at back ground color

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

sunny_talwar

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

Capture.PNG

paulyeo11
Master
Master
Author

Hi Sir

=if

(

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

)

)

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

Paul

ankit777
Specialist
Specialist

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

Not applicable

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

ankit777
Specialist
Specialist

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.

paulyeo11
Master
Master
Author

Hi Kumar

it work , thank you vey much

Not applicable

ywc