Solved! Go to Solution.
You can calculate Group_Date and SEQID in the same rule:
// Calculation Attribute Rule
// triggers: Insert
// Field: empty
// Calculate Group_Date
var group_date = $feature.Group_Number + "_" + Text($feature.CREATEDATE, "Y-MM-DD")
// Find all existing features with the same Group_Date
var features_with_same_group_date = Filter($featureset, "Group_Date = @group_date")
// Calculate SEQID
var next_id = Count(features_with_same_group_date) + 1
var seq_id = group_date + "_" + next_id
// Return Group_Date and SEQID
return {
"result": {"attributes": {
"Group_Date": group_date, "SEQID": seq_id
}}
}
No idea if this will work offline...
You can calculate Group_Date and SEQID in the same rule:
// Calculation Attribute Rule
// triggers: Insert
// Field: empty
// Calculate Group_Date
var group_date = $feature.Group_Number + "_" + Text($feature.CREATEDATE, "Y-MM-DD")
// Find all existing features with the same Group_Date
var features_with_same_group_date = Filter($featureset, "Group_Date = @group_date")
// Calculate SEQID
var next_id = Count(features_with_same_group_date) + 1
var seq_id = group_date + "_" + next_id
// Return Group_Date and SEQID
return {
"result": {"attributes": {
"Group_Date": group_date, "SEQID": seq_id
}}
}
No idea if this will work offline...
It worked great! I was trying to make NextSequenceValue work and didn't even consider just using a Count function. Brilliant.