2

New to Qlikview, not yet familiar with scripting. My data has two dimensions, Month and HSETimes (4 categories), and the expression is Count(HSETimes). A stacked bar chart using relative values returns the percentage of the total by month by category.

I need an expression to return each months total as 100% with each category proportionately represented to produce a bar chart similar to the attached image, but I do not know how to write the expression: have tried many combinations of subset and total to no avail. Should be simple: can anyone help? ChartSample

S O'Dea
  • 21
  • 1
  • 5

1 Answers1

1

Using the relative checkbox on a bar chart rarely results in the desired output. To accomplish what you want, uncheck the "Relative" checkbox, and modify your expression to explicitly calculate the percentage you want.

Dimensions: Month, Category

Expression: count(HSETimes) / count(total<Month> HSETimes)

Using total<Month> is part of the set modifier syntax and will result in your denominator being the total per month while your numerator will still be the count for each month and category.

Also, ensure you have the "stacked" bar type selected in the "style" menu and set your number format in the "Number" menu to show in percent.

See here for more info on set modifiers. Or you can google 'set analysis', 'total modifier', 'set modifiers' and that should help you find more info.

bdiamante
  • 15,980
  • 6
  • 40
  • 46
  • Thank you: the link at "here" is a good one, I have had difficulty finding clear and accessible information regarding set analysis: this helps. – S O'Dea Aug 17 '17 at 12:06