How to return unique values from the field/column of table fgdB which participates in the relationship 1:M? I need unique values for the related report. Distinct keyword in Arcade does not do this on field/column (only on array, tested), and in SQL for file geodatabase this keyword is not supported!
Thanks for any help!
You're using the incorrect syntax for the Distinct function for a FeatureSet. It should be
Distinct($layer, 'fieldName')
//or
Distinct($layer, ['fieldName1', 'fieldName2'])
What are you trying to do with this code? This affects what profile variables and functions you're able to use in your code. For example, labeling and visualization gives you a very limited set of profile variables and function bundles for efficiency reasons, whereas field calculations and popups give you more.
In any case, you can't use "$Kartirane geoloske jedinice", since that is not a FeatureSet variable.
THANK YOU VERY MUCH! In the first question I explained that I want to return unique values from a field/column of the fgdB table that participates in a 1:M relationship, so that I can create a report. "$Kartirane geoloske jedinice"("$Mapped geological units") is an alias of FC/layer name, and ''Peferisana starost''(''Preferred age'') is the name (alias) of the field/column from which I need to return unique values.
Best Regards!
Branislav
The Distinct function for FeatureSets has the syntax
with the "features" variable being a FeatureSet and the "fields" variable being either a single field name or an array of field names.
How you get the features variable depends on where you're using the Arcade code. It could be using the variable $datastore or $layer. Or you might need to get it from a function like FeatureSetByName or FeatureSetByPortalItem
What do you get if you use this in your code?
Distinct($layer, "Peferisana starost")
With my code Distinct($layer, "Peferisana starost") result is
Branislav
You're using the layer name instead of "$layer"
Please excuse me, I was not able to answer you yesterday. I experimented with more code syntax (see attached of your proposal), but without success. Thanks for your time, obviously I have to look for another solution. I also tried with 'join outer', FC and tables, the result was also unsuccessful
@AlyciaRajendran_esri, please help!
BEST Regards!