I have an action that creates a new row, gets the [ID] and [NOME CLIENTE] from the old. I need to automatically increase the [NUM.] value in the new row, so I want to get the maximum number of the column [NUM.] form all the rows who share the same [ID] value.
I’m currently using this formula: MAX(SELECT(Lavorazioni[Num.],ID=[_THISROW].[ID]))+1
In AppSheet, your expression syntax is correct in principle, but SELECT() returns a list, so you need to ensure the data type matches what MAX() expects. If [Num.] is stored as text rather than a number, MAX() won’t work as intended. First, confirm [Num.] is a Number type in Data > Columns. Then use:
MAX(
SELECT(Lavorazioni[Num.], [ID] = [_THISROW].[ID])
) + 1
```
Also make sure the `[ID]` comparison is using the correct column type and matches exactly. If this runs in an initial value or App Formula for `[Num.]`, it will auto-increment based on the highest existing value for that ID.
Thanks and regards,
Taz