6 Replies Latest reply: Nov 29, 2009 10:24 PM by Valeriy Shylin RSS

    Add a total line to a chart

    Valeriy Shylin

      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

        • Add a total line to a chart

          Valera,

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

          Aggr(Sum(requested),date)

          regards, Jan

           

            • Add a total line to a chart
              Valeriy Shylin

              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

            • Add a total line to a chart

              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

                • Add a total line to a chart
                  Valeriy Shylin

                  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!

                • Add a total line to a chart

                  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