Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

ratio calculation

Hi every one. I am new in Qlik and want to ask a question. I have a set of data with 5 variable. one of them is school name. In this variable how can I calculate ratio of one school vs all others.

26 Replies
sunny_talwar

I don't think TOTAL is required here, you can just use (and note the missing curly bracket in red)

=Count({<schoolname={'nursing'}>} schoolname)/Count(schoolname)

and if you are doing this in a straight table with schoolname as your dimension, then try this:

=Count(schoolname)/Count(TOTAL schoolname)

Anonymous
Not applicable
Author

From my point of view, I think Total is required.

The reason behind this is: If I am having any measure field like Sales, NoOfFaculty then I need to group w.r.t Dim like

=sum(<Total SchoolName> NoOfFaculty)

sunny_talwar

Here is any example to show that TOTAL is not required

Capture.PNG

Anonymous
Not applicable
Author

Did you try what I suggested you??

Replace FieldName with Score or Course...

Not applicable
Author

Thank you all for your answers and special thank for dear Sunny

sunny_talwar

No problem

Anonymous
Not applicable
Author

Sunny,

For me School is a Dim not a measure, Even you would be agree on same.

Now If I want to see score % then:

I would go for this:

=sum(<School={'Nursing'}>} Score) / sum(<Total School> Score) which would give Nursing % wrt to total.

This is what I am trying to say...

sunny_talwar

Balraj, there are couple of things

1) Your syntax for the expression is not right:

=Sum({<School={'Nursing'}>} Score) / Sum(Total <School> Score)


2) I am not sure which object would need this expression? Would you be able to implement your expression into previously attached qvw?

Thanks,

Sunny

Anonymous
Not applicable
Author

Oops, wrong syntax...sorry for the inconvenience.

I was saying like this:

=Sum({<School={'Nursing'}>} Score) / Sum(Total Score)

sunny_talwar

Balraj Ahlawat wrote:

=Sum({<School={'Nursing'}>} Score) / Sum(Total Score)

Show an implementation of this then. I still don't think you need TOTAL in denominator.