Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
edg
Partner - Contributor II
Partner - Contributor II

Order of Operations for Calculation

I have a calculated field that produces a rate.

count({$<[Type] = {'C'}>} distinct [Number])

/

Sum(Total_Units)

 

I need the square root of the result.  I've tried the following, including adding extra parenthesis so the rate is calculated before the sqrt.  However, it's taking the square root of count({$<[Type] = {'C'}>} distinct [Number]) before dividing by Sum(Total_Units)). 

Does anyone know how to get the total result and then take the square root?

 

sqrt(

(count({$<[Type] = {'C'}>} distinct [Number])

/

Sum(Total_Units))

)

 

Thank you in advance.

1 Solution

Accepted Solutions
Or
MVP
MVP

I'm not able to replicate your example...

Or_2-1627402601060.png

 

 

In the above, the result of the final sqrt() formlua is correct - sqrt(4/400) = sqrt(0.01) = 0.1. If it were sqrt(4)/400 as you describe, the result would be 0.005 instead.

View solution in original post

1 Reply
Or
MVP
MVP

I'm not able to replicate your example...

Or_2-1627402601060.png

 

 

In the above, the result of the final sqrt() formlua is correct - sqrt(4/400) = sqrt(0.01) = 0.1. If it were sqrt(4)/400 as you describe, the result would be 0.005 instead.