<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>How to add MAX() database aggregation function inside appian queryEntity() function?</title><link>https://community.appian.com/discussions/f/data/14935/how-to-add-max-database-aggregation-function-inside-appian-queryentity-function</link><description>Hi, 
 I want to execute a query like &amp;quot; SELECT MIN(Price) AS SmallestPrice FROM Products;&amp;quot; in queryEntity() . How can I do that?</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: How to add MAX() database aggregation function inside appian queryEntity() function?</title><link>https://community.appian.com/thread/66844?ContentTypeID=1</link><pubDate>Fri, 24 May 2019 17:48:43 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:81984147-8cb6-472f-b814-3378a37e3ceb</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;Basically you define an a!queryAggregationColumn() with the &amp;quot;field&amp;quot; set to i.e. &amp;quot;Price&amp;quot;, and &amp;quot;aggregationFunciton&amp;quot; set to &amp;quot;MAX&amp;quot; (or &amp;quot;MIN&amp;quot; per your original post).&amp;nbsp; You can optionally specify an &amp;quot;alias&amp;quot; to name the resulting aggregation something more appropriate (like &amp;quot;MinPrice&amp;quot;).&lt;/p&gt;
&lt;p&gt;Note that you must also define a grouping column.&amp;nbsp; This is basically like having a WHERE clause in your SQL, mapping to an absolute value of some other column.&amp;nbsp; An easy example would be like&amp;nbsp;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span class="sqlkeywordcolor"&gt;SELECT&lt;/span&gt;&lt;span&gt;&amp;nbsp;MIN(Price)&amp;nbsp;&lt;/span&gt;&lt;span class="sqlkeywordcolor"&gt;AS&lt;/span&gt;&lt;span&gt;&amp;nbsp;SmallestPrice&amp;nbsp;&lt;/span&gt;&lt;span class="sqlkeywordcolor"&gt;FROM&lt;/span&gt;&lt;span&gt;&amp;nbsp;Products WHERE IsActive = TRUE;&amp;quot;.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to add MAX() database aggregation function inside appian queryEntity() function?</title><link>https://community.appian.com/thread/66832?ContentTypeID=1</link><pubDate>Fri, 24 May 2019 07:52:50 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:5bd656d0-2992-4f54-9ef1-fbeb8654109f</guid><dc:creator>sudip.das005</dc:creator><description>&lt;p&gt;I used a!&lt;span&gt;queryAggregationColumn() but could not figure out how to use it with MAX function&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to add MAX() database aggregation function inside appian queryEntity() function?</title><link>https://community.appian.com/thread/66830?ContentTypeID=1</link><pubDate>Fri, 24 May 2019 07:33:36 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:d937af6f-5d0d-4fee-8efd-43a978a2c3e0</guid><dc:creator>Thasneem Nisa </dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;You can make use of a!queryAggregationColumn() function. Please visit the following URL to see some of the Query Entity examples with Aggregation.&amp;nbsp;&lt;a href="https://docs.appian.com/suite/help/19.1/Query_Recipes.html"&gt;https://docs.appian.com/suite/help/19.1/Query_Recipes.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Thasneem&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>