Select to view content in your preferred language

Calculating a field using Orderby

261
3
08-01-2024 05:03 PM
Azita
by
New Contributor

Hello!

GIS newbie here looking for help with an Arcade expression.

I have a field named BeginTime with content such as "2024-06-20T11:36:31-07:00, 2024-06-20T11:36:16-07:00." I'm honestly not sure what the 07:00 is about but the orange timestamp is what I'm looking to use to number my field, "TPE." I want TPE to list the features/points as integers in order of time collected.

I'm not sure what it means by "wrong number of arguments."

 

Screenshot 2024-08-01 165852.png

 

Thanks!

 

Azita

0 Kudos
3 Replies
jcarlson
MVP Esteemed Contributor

OrderBy takes two arguments, a FeatureSet and a SQL expression used to sort the features.

You can definitely still use Arcade for this, but it's probably not going to work very well. In a field calculation, the expression will have to evaluate for every feature separately, but since the value you want is dependent up on each feature's relation with every other feature, well, that expression could take a long time to run.

This wouldn't be terrible in Python, perhaps, but you're almost better off exporting to a spreadsheet, sorting the sheet and adding an auto-increment value there, then joining the sheet back into your layer based on the objectid. Then you could just refer to the joined field in your field calculation.

- Josh Carlson
Kendall County GIS
vsogekr9
New Contributor

Ah legend, it works! I'm not too sure why though, still very new to SQL. Could you explain what left outer and join does?

And ya the 'Likes has no default value' is weird. I think it could be because the column heading isn't the name of the column or something like that but not too sure.

0 Kudos
vsogekr9
New Contributor

@vsogekr9 wrote:

Ah legend, it works! I'm not too sure why though, still very new to SQL. Could you explain what left outer and join does?

And ya the 'Likes has no default value' is weird. I think it could be because the column heading isn't the name of the column or something like that but not too sure https://omegle.onl/ .


I got this,...

0 Kudos