Hi,
I am trying to create a calculated field which is essentially {Total Fee Value}/{Total Payment Received Onwards}. It is just to get an Average of the Total Fee Value per day as my visual is just a table which is grouped by a date and has many custom calculated field values.
The {Total Fee Value} field is a sum of 4 other calculated fields which all look like this with different states:
ifelse({CaseID Row Rank} = 1 AND (state = ‘State 1’ OR state = ‘State 2’), {totalfee}, 0)
The CaseID Row Rank is another calculated field which will just rank my data records as there are {CaseID} level duplicated within the data which all have {totalfee} and when it sums it I only want it to sum once per {CaseID} and that was the only way I knew how to do it.
The {Total Payment Received Onwards} is a sum of 4 other calculated fields which all look like this with different states: : distinct_countIf(caseid, state = ‘State 1’ OR state = ‘State 2’)
So I essentially have 4 pairs of matching calculated field where one will distinct count the {CaseIDs} and the other will sum the {totalfee}.
I am getting an error of Mismatched aggregation: ‘Custom aggregations can’t contain both aggregate “COUNT
” and non-aggregated fields “COUNT(DISTINCT CASE WHEN…’
This is an example of how my data looks and why I created the {CaseID Row Rank}:
I am not sure about how to get this average field into my data/visual. I can provide further screenshots if that would be of any use.
Any help will be greatly appreciated, thank you.
Riley