Calculated Field Cumulative Total or Sum (Attribute not in field well)

Hello All

I’m trying to calculate a running total for the calculation

“distinct_countIf(caseid, isNull(successfuloutcomedate))”

I’ve tried
“sumOver(distinct_count(caseid),[isNull(successfuloutcomedate) ASC])”
and
“runningSum(distinct_count(caseid),[isNull(successfuloutcomedate) ASC])”

In both instances I get the error “Table calculation attribute reference(s) are missing in field wells”.

Any ideas for the above would be appreciated.

Thanks

Alex

1 Like

Hi Alex, Hope This message finds you well!!

The error “Table calculation attribute reference(s) are missing in field wells” usually indicates that all fields used in calculations need to be present in the visualisation’s fields.
So, caseid and the fields involved in the condition isNull(successfuloutcomedate) need to be added to your visualisation.
To calculate the cumulative total with distinct_count, first, create a calculated field to handle the distinct count, something like:

1distinctCaseCount = distinct_countIf(caseid, isNull(successfuloutcomedate))

Then, use the runningSum function with this:

runningTotal = runningSum({distinctCaseCount}, [<dimension> ASC])

<dimension> could be the field that order your data, such as a date field.

Tell me if it’s help you!

2 Likes