AnsweredAssumed Answered

Count unique instances of a value within a repeat using SUM

Question asked by hashimotoy on Nov 8, 2018
Latest reply on Nov 9, 2018 by hashimotoy

I am wanting to count the unique instances of a value within a repeat. Others have had the same issues resolved by explicitly casting the values as integers but this isn't resolving my issue.

Survey123 Addition Calculation Treating Numericals as Text Fields  

sum() Aggregate function, appends values, doesnt add them 

 

I have a calculate field based on a conditional IF statement such that if the condition is met a value is set. Outside of the repeat I have a sum of the conditional field. But instead of summing the integers, the output is a concatenation of text despite trying to cast values as integers and binding as an esriFieldTypeInteger.

 

if(condition),1,0)

sum(FIELD)

 

Attached is this example.

e.g.Instead of the value 2, I have 10100

typenamelabelcalculationbind::esri:fieldType
begin repeatRatings
select_one ratingRatingRating
calculateCount_1_Starif(${Rating}=1,int(1),int(0))esriFieldTypeInteger
integernoteNote${Count_1_Star}
end repeat 
integerInteger_CountCountsum(${Count_1_Star})esriFieldTypeInteger

Attachments

Outcomes