cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Issue with Using MAX Formula in SAP Build Apps - Only First Row Accessible

Hossam_Fathy
Explorer
0 Kudos
207

Hello,

I am facing an issue when trying to use the MAX formula in SAP Build Apps. I want to get the maximum value from a specific column in my data variable. However, when I try to select a column, I can only choose it from the first row (e.g., data.App1[0].Qty) instead of selecting the entire column (e.g., data.App1[].Qty).

Expected behavior:

  • The MAX function should be able to evaluate the entire list of numeric values in a column.

Observed behavior:

  • The formula editor only allows selecting a column from the first row (data.App1[0].Qty), which does not provide the expected result for the whole dataset.

Has anyone encountered this issue before? Is there a workaround or a correct way to reference an entire column in SAP Build Apps formulas?

Accepted Solutions (0)

Answers (1)

Answers (1)

Dan_Wroblewski
Developer Advocate
Developer Advocate
0 Kudos

If you want the max of a certain, use a formula like this. I used Northwind's Product entity, and wanted the maximum unit price among all the products.

MAX(PLUCK(data.Employees1,"UnitPrice"))

 If you want the records, you can just sort the list:

SORT_BY_KEY(data.Employees1, "UnitPrice","desc")

The returned JSON is not like a database that has the ability to think of the data as rows and columns. It is just JSON, as far as I understand.