Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Performaing a calculation of percentage of a counted field

Hi all,
I am loading a spreadsheet into Qliview that has a field called Status and a field called Severity.
It is a risk log which has 1 row for each risk, with each row having a status and a severity.

I would like to be able to calculated the count of a contatenation of the two fields and plot it as a stacked bar chart as a percentage of the total count.

e.g:

This is what is being loaded in (cut down the number of fields for this example)
RiskID Risk_Name Status Severity

1 Risk1 Open H
2 Risk2 Closed H
3 Risk3 Open H
4 Risk4 Closed H
5 Risk5 Closed M
6 Risk6 Open M
7 Risk7 Closed L
8 Risk8 Closed L
9 Risk9 Open L


so the stats would be calculated as
OpenH 2 22%
ClosedH 2 22%
OpenM 1 11%
ClosedM 1 11%
OpenL 2 22%
ClosedL 1 11%

Total 9 100%

my graph would then be plotted with these as a percentage

Can anybody suggest how I can do this in the script?

Thanks in advance!
Matt

1 Solution

Accepted Solutions
Not applicable
Author

Alongside the expressions, you have 'Relative' checkbox, will that help?

View solution in original post

3 Replies
Not applicable
Author

When you are loading the data, Load Status&Severity as NewStatus Field.

Then you should be able to plot the chart, without doing anything more in the script, as for the field, QV will keep the stats of Count and total count.

Not applicable
Author

I cannot work out how to plot as a percentage in a bar chart though.

I have the concatenated field in the script and can plot a COUNT of the concatenation.

I have looked through the reference manual but cannot work out how to do it. Are you able to advise?

thanks,

Matt

Not applicable
Author

Alongside the expressions, you have 'Relative' checkbox, will that help?