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: 
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
sunny_talwar

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

Not applicable
Author

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.

sunny_talwar

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
Author

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).



sunny_talwar

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
Author

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