Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Add a total line to a chart

Hi guys,

I'm having a problem in adding a TOTAL line to a line chart.

Assume that the chart has 2 dimensions: Date and Customer.

The expression simply shows the sum of requested goods.

So, I wanted to add an additional line that would show me the total of requested goods per Date.

How can I do this?

Thanks.

Valera

6 Replies
Not applicable
Author

Valera,

I think the following expression will do the job. (assuming the date is the primary dimension)

Aggr(Sum(requested),date)

regards, Jan

Anonymous
Not applicable
Author

Hi Jan,

the expression works well and I already tried it. 🙂

The problem is that when I add this expression as the second one, the chart stops considering its second dimension (Customers). So, the result is that my line chart displays just one line: since the second dimension is not considered the first expression (sum(requested)) is by default aggregated by date. The second expression produces the same output. So, the result is 2 lines which perfectly overlap. I see just one line on the chart instead of a number of lines per Customers + 1 Total line.

So, as I can understand, I can not add a second expression without losing the chart's structure. Is there any workaround?

Thanks.

Valera

Not applicable
Author

Hi Valera,

I see what you mean, in my case the lines don't overlap, but they don't make any sense at all.

A work-around might be to present the customer values as bars?

If this is not what you are looking, maybe you could add a picture of the desired result

Jan

Anonymous
Not applicable
Author

OK,

here's the source chart - the departure point.

The dimensions are Date and Customer.

The expression is sum(RequestedQty)

All I need is a third line showing the requested total per date. 🙂

Instead, when I add another expression I get this:

I get an absolutely the same line if I get rid of the Customer field in the dimensions. So, the lines from the two expressions seem to perfectly overlap.

So, how do I add the third line of totals? 🙂

Thanks!

Not applicable
Author

Hi Valera,

Interesting problem . . . . seems like a QV inconsistency, so here is another try 🙂

The only work-around I can come up with is adding an IF statement to the expression:

so 1: sum(if (customer='H', req)), 2: sum(if (customer='S', req)) and for the total line: sum(req)

So I hope you don't have too many customers for this graph

Jan

Anonymous
Not applicable
Author

Yep, actually, this is how I solved the problem. As long as I had 2 customers it worked well. Though, the original structure of the chart was changed...

Thanks for help. 🙂

Valera