Ryan James 3 Posted July 26, 2022 Share Posted July 26, 2022 I am have monthly data that I am trying to count non - null unique values. But I keep getting the wrong results. Here is an an example:I have the following data:Well Month Volume A 1 12A 2 10A 3 11B 1 0B 2 0B 3 0I am try to get the following result:Total Wells Wells Greater than Zero2 1This is my formulaUnique Count ([Wells]) as [Total Wells],Unique Count(CASE WHEN sum([Volume]) > 0 THEN [Well] ELSE NULL END) AS [Wells Gretter than Zero]However I get two in both columns. What am I doing wrong? Thanks, Link to comment Share on other sites More sharing options...
Gaia Paolini Posted July 27, 2022 Share Posted July 27, 2022 This would work as a calculated column in a table:Sum(Integer(sum([Volume]) over ([Well])>0)) / Count(RowId()) over ([Well])where sum([Volume]) over ([Well])>0 is True for well A and False for well BInteger(of the above) gives you 1 for True and 0 for FalseSum(of the above) gives you 3 for 1 and 0 for 0Count(RowId()) over ([Well]) normalizes the count to 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now