Select to view content in your preferred language

Sum repeat is causing a empty data entry for the first repeat in the feature service

384
3
10-11-2023 08:17 AM
NatalieSlayden
New Contributor III

Hi, I have a repeat and am totaling based on which species is selected and if they select disease. Currently I have a field within the repeat with the calculation CalcACERCondition: 

if(selected(${SpeciesType},'Acropora cervicornis') and selected(${GridCondition},'DiseasePresent'), 1, 0)

I then have a field outside of the repeat that sums those "1" values with calculation: sum(${CalcACERCondition})

In my feature service the first repeat is always blank and then the repeats follow. I heard previously this occurs when doing calculations within a repeat. Is there a way to get around this so there are no blank repeat entries?

Thanks for the help!

0 Kudos
3 Replies
DougBrowning
MVP Esteemed Contributor

Have you tried putting a relevant on the calc line tied to the SpeciesType field?  I have seen the blank lines also.

0 Kudos
NatalieSlayden
New Contributor III

I was not able to get that to work. It seems like when you sum a repeat it automatically sums first entry before you even select anything.

 

0 Kudos
DougBrowning
MVP Esteemed Contributor

Mmm for one project I did add a if(count() > 0 or count() > 1 I forget that got around this. Or maybe a relevant on the sum field?

0 Kudos