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

Add a total bar to a stacked bar chart

Hello !

I searched for a solution for this problem for some time now but without succes.

So, what i have is a dimension and a few measures based on percentage i took from the excel that was given to me, i then use them in a stacked bar chart :

currentChart.png

And what i want is add a 'total' bar with the sum of the measures for all the years like so (on excel):

targetChart.png

Is there a way to do that?

The data i have roughly look like that :

clientYear2017Year2016Year2015Year2014
1waiting
2okwaiting
3gave up
4not ok
5ok


my dimension is declared like so :

if(

[Year2014]='' and [Year2015]='' and [Year2016]='',

'Cohorte2017',

    if(

    [Year2014]='' and [Year2015]='',

    'Cohorte2016',

        if(

        [Year2014]='',

            'Cohorte2015',

            'Cohorte2014'

        )

)

)

and here is an example of one of the measures that i then transform into %:

Sum(

  if(

      [Year2017]='' and [Year2016]='' and [Year2015]='' and [Year2014]='',

      0,

      if(

          [Year2017]='',

          if(

              [Year2016]='',

              if(

                  [Year2015]='',

                  if([Year2014]='waiting',1,0),

                  if([Year2015]='waiting',1,0)

              ),

              if([Year2016]='waiting',1,0)

          ),

          if([Year2017]='waiting',1,0)

      )

  )

)

thanks in advance !

0 Replies