Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm new to Qlikview and struggling with some simple calculations. I'm trying to show a percentage of headcount by department/headcount in a building. Below is an example what I am trying to achieve for building A, but for each building. I hard coded the total just show an example. I've tried a number for formulas with Sum, but it never calculates correctly or at all. How do I do this?
maybe
count(Head) / count(TOTAL <BL_ID> Head)
from online help
If the word total occurs before the function arguments the calculation will be made over all possible values given the current selections but disregarding the chart dimension variables.
The total qualifier may be followed by a list of one or more field names within angle brackets. These field names should be a subset of the chart dimension variables. In this case the calculation will be made disregarding all chart dimension variables except those listed, i.e. one value will be returned for each combination of field values in the listed dimension fields. Also fields which are not currently a dimension in a chart may be included in the list. This may be useful in the case of group dimensions, where the dimension fields are not fixed. Listing all of the variables in the group causes the function to work when the cycle or drill-down level changes.
Can you send me the expression you used for the final % calculation?
maybe
count(Head) / count(TOTAL <BL_ID> Head)
from online help
If the word total occurs before the function arguments the calculation will be made over all possible values given the current selections but disregarding the chart dimension variables.
The total qualifier may be followed by a list of one or more field names within angle brackets. These field names should be a subset of the chart dimension variables. In this case the calculation will be made disregarding all chart dimension variables except those listed, i.e. one value will be returned for each combination of field values in the listed dimension fields. Also fields which are not currently a dimension in a chart may be included in the list. This may be useful in the case of group dimensions, where the dimension fields are not fixed. Listing all of the variables in the group causes the function to work when the cycle or drill-down level changes.
To show the example I just used [Head Count by Department]/170. 170 is the total occupancy of building A. I was trying to do something like [Head Count by Department]/Sum(TOTAL(<[Head Count by Department]> HEADCOUNT) but it doesn't calculate anything. I've tried numerous variations. The denominator calculation is what I am trying to get. Thanks for your time.
Yep. That did it. I used count(EMP_ID)/count(TOTAL <BL_ID> EMP_ID). Thank you!