Select to view content in your preferred language

Arcade expression

59
2
7 hours ago
BSBlagojevic
Regular Contributor

How to resolve this bizarre thing? I have many values in table which is repeating, and I need only one value in my report. I try to use simple arcade function 'distinct', but it returns all values

 

0 Kudos
2 Replies
MErikReedAugusta
MVP Regular Contributor

Per the documentation, Distinct returns every unique value in your dataset.

For example, if you had a table with 7 rows where the values in the desired column were [A, B, A, C, D, E, B], Distinct would return [A, B, C, D, E].  So in most cases, it SHOULD produce more than one value.

If you want only one value, your first question is which value.  Many scripts use First() to just take whatever the first record says, but it depends on whether you need that value or another.

We might be able to give you more specific help if you can share your script and/or an representative sample of data.

------------------------------
M Reed
"The pessimist may be right oftener than the optimist, but the optimist has more fun, and neither can stop the march of events anyhow." — Lazarus Long, in Time Enough for Love, by Robert A. Heinlein

If this post or another helped you out, please consider giving the post(s) a Kudo or marking them as the Solution. ESRI Staff use both of these features to help keep track of posts on these forums.
0 Kudos
BSBlagojevic
Regular Contributor

Thanks! The table contents many repeating values A, A, A, B,B, C,C,C, D, E,E...and I need all of it only once!

My query: Distinct ($feature.Naziv), were naziv(name) of the feature), but no result! 

0 Kudos