Hi,
I want to execute a query like "SELECT MIN(Price) AS SmallestPrice FROM Products;" in queryEntity() . How can I do that?
Discussion posts and replies are publicly visible
You can make use of a!queryAggregationColumn() function. Please visit the following URL to see some of the Query Entity examples with Aggregation. https://docs.appian.com/suite/help/19.1/Query_Recipes.html
Thanks,
Thasneem
I used a!queryAggregationColumn() but could not figure out how to use it with MAX function
Basically you define an a!queryAggregationColumn() with the "field" set to i.e. "Price", and "aggregationFunciton" set to "MAX" (or "MIN" per your original post). You can optionally specify an "alias" to name the resulting aggregation something more appropriate (like "MinPrice").
Note that you must also define a grouping column. This is basically like having a WHERE clause in your SQL, mapping to an absolute value of some other column. An easy example would be like "SELECT MIN(Price) AS SmallestPrice FROM Products WHERE IsActive = TRUE;".