2 Replies Latest reply: Jul 15, 2016 2:02 PM by M Aster RSS

    Create a bar chart from different columns

    M Aster

      I´m very new to Qlik Sense, I would like to create a bar chart with the sum of column A, B, C, D .... and J from a loaded table.

      I could currently achieve this by creating 10 separate bar charts each with:

      Dimension: ='Total Column X'

      Measure:  =Sum(X)

       

      I'm sure there is a way to do this in one chart. I kind of got it to work by creating a grouped bar chart but that did have only one label below the bars.

       

      I'm reading the forum for a couple of days, please be easy on the jargon like 'just warp the grouped dimension on the calculated measure reference joined inner table nested group alternative'  I feel I really need click-by-click instruction because 80% of the answers here make me dizzy.

        • Re: Create a bar chart from different columns
          Bill Markham

          Not sure I fully understand your question, but would creating a single bar chart with one dimension and ten expressions suffice ?

           

          When you say, Dimension: ='Total Column X' I am confused as what you mean by that.

            • Re: Create a bar chart from different columns
              M Aster

              Hi Bill, thanks for your response.

               

              I came quite far till now but I want to nail this one a nice 'one liner':

               

              I learned that if I make the Dimension a fixed string it shows one bar e.g.  dimension ='Total A'  with measure =sum(columnA) this creates 1 bar with all the values in ColumnA added up and a label on the x axis with 'Total A'. This is great and is exactly what I need. But now I want 10 of those bars in one chart.  I can add measures but then the bars don't get labels on X axis but appear as colors in the legend.

               

              I created an INLINE table [ MyBars: 'columnA', 'columnB', columnC' .... 'columnJ' ]  if I now create a chart with Dimension 'MyBars' I get nicely the columnA to J on the X axis, but now remains how to get the '=sum(<<columnName>>). 

               

               

              I hope there is some nice trick e.g.

               

              Measure:   =sum( SELECT_FIELD(${value_on_X));

               

              So I will get a chart with 10 bars,   bar 1 (columnA) with the sum of all values in columnA, bar 2 , columnB with all the totals of values in column B... Ideally this would be dynamic e.g.:

               

              Dimension :     "columns 15 - 25 of Table XYZ on X axis"

              Measure:     "For the colum mentioned on X axis give me the SUM of all values in it"