3 Replies Latest reply: Jun 12, 2018 5:08 PM by Mohamed Elafifi RSS

    Bar chart with bar percent relative to entire chart

    Mohamed Elafifi

      Hi Qlik community!

       

      I have a bar graph that currently displays the counts of incidents. I also have a custom toggle, that when clicked, changes the KPI's on the sheet to a percentage, instead of a count. I want to implement this on a bar graph, but I am having an issue summing up all the values within the bar graph itself. Here is a picture of the current bar graph:

       

      EHS_Snippet.PNG

      As you can see, the totals of the bars above add up to 42. So when I click the percentage toggle (not shown here), for the first bar at the top I expect to see 10/42*100 which would amount to 23.8 percent. However, I am getting 10/10 which is understandable because it is only counting the total for that dimension/measure combo.

       

      So, does anyone know a calculation that will sum up the values from the entire bar chart, so that I can be able to divide by it to produce a percentage upon toggling?

       

      Any help will be much appreciated!

       

      Mohamed

       

      EDIT/NOTE: The number needs to be dynamic, so I cannot create a static variable!