Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
Not applicable

Color By Expression

Hi All,

I have a data modell like this:

    direction values here: in or out

    amount: values here numbers

    date: values here ...

I would like to make an accumulated line chart (succeeded) which represents the incomes and expenses, and colored the two line with an expression  (not succeeded).

Dimension: date

Measures:

     RangeSum(Above(Sum({<direction={'in'}>}amount),0,RowNo())) and

     RangeSum(Above(Sum({<direction={'out'}>}amount),0,RowNo()))

Coloring:

Color and legend / Colors by expression: if(direction='in',lightred(),lightgreen()).

Please help me how can I set up the colors with expression for the lines.

qvf, pic and data are attached.

Thanks,

Daniel

6 Replies

Re: Color By Expression

Would you be able to point out what is wrong with the image you have attached? What do you expect to see?

Not applicable

Re: Color By Expression

Hi Sunny, I have two lines as you can see in the picture, one is representing income and the other is representing the loss, i would like to coloring the 1st to green 2nd to red.

Re: Color By Expression

I guess Qlik Sense isn't allowing us to do that. You can have them in two different colors, but it doesn't let you pick the colors.

Capture.PNG

Not applicable

Re: Color By Expression

It has this feature, check this post color by expression - QlikSense

and this comment jpe Aug 25, 2014 1:13 PM (in response to Philipp Wesseling).



Re: Color By Expression

I think in there case Year was one of the dimensions whereas in your case direction is not one of the dimensions..... I tried with two dimension and a single expression, but the charts don't match. But check it out for urself if it makes sense to use this

Capture.PNG

Not applicable

Re: Color By Expression

it is bad that Sense doesn't use the logic what View has (color option in each expression) but thanks Sunny  for your effort.

I will keep open the post maybe somebody has another suggestion...

Regards,

Daniel

Community Browser