Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
Valera,
I think the following expression will do the job. (assuming the date is the primary dimension)
Aggr(Sum(requested),date)
regards, Jan
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
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!
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
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