Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Accumulation in line chart - Change line colour from a certain accumulated point onwards

Dear all,

I am having a problem with the design of a line chart.

I have it done so that we see on the x-axis the clients ranked by the amount of sales, and on the y-axis we see the relative accumulated sales with respect to the total amount of sales.

This is the look of my graph right now.

However, I would like to have it done so that from the point in which line crosses 25 % onwards, its color changes from blue to red. Do you know how can I do this?

I have tried with this formula in the colour option of the expression, but I do not get the results that I am looking for:

if((RangeSum(Above(rank(sum({$<INVOICEYEAR={'2014'}>}(WEIGHT/1000))),0,RowNo())))/(sum({$<INVOICEYEAR={'2014'}>}(WEIGHT/1000)))<='0,25',rgb(0,0,0),rgb(255,0,0))

Can anybody help me please?

Thank you very much!!

Jorge

1 Solution

Accepted Solutions
morganaaron
Specialist
Specialist

Hi Jorge,

There may well be a way to do it, the only way I can think of doing it relies on breaking the expression down by each ranking, meaning you won't get it at the 25% level, but at the clients who contribute to break the 25% barrier, if that makes sense.

I've included an app I put together that demo's it here so you can see what it's doing, depending on how many clients you're dealing with and how much they contribute will depend on how close to 25% you get, but it'll stop once the client pushes it over that 25% limit.

Aaron

View solution in original post

5 Replies
Not applicable
Author

Sorry! I forgot to clear out that "INVOICEYEAR" and "WEIGHT" are fields of the database

Thanks!

morganaaron
Specialist
Specialist

Hi Jorge,

There may well be a way to do it, the only way I can think of doing it relies on breaking the expression down by each ranking, meaning you won't get it at the 25% level, but at the clients who contribute to break the 25% barrier, if that makes sense.

I've included an app I put together that demo's it here so you can see what it's doing, depending on how many clients you're dealing with and how much they contribute will depend on how close to 25% you get, but it'll stop once the client pushes it over that 25% limit.

Aaron

Not applicable
Author

Hi Jorge,

can you post up an example application


Joe

Not applicable
Author

Thank you Aaron! Finally I found the answer to my problems!

Jorge

Not applicable
Author

Dear all,

I have tries for quite a lot of time but I have found a new problem regarding the same line chart.

I have tried to draw a line that crosses the line in the same point at which it changes the colour. (where it crosses +25% of sales), as you can see in this line chart done via excel.

I have tried to use following formula in Presentation-->Reference Lines-->X continuous selected

RangeSum(Above(Sum(Total {$<INVOICEYEAR={'2014'}>}(WEIGHT/1000)),0,Aggr(Rank(Sum(Total {$<INVOICEYEAR={'2014'}>}(WEIGHT/1000)),4),CLIENTNAME)))*0.25

But I only manage the name to cross at point X=0.

Can anybody please help me?

Thank you!