<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Feature Report summary statistics / aggregate functions for orderBy with multiple filters in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/feature-report-summary-statistics-aggregate/m-p/1070638#M35389</link>
    <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1213"&gt;@JamesTedrick&lt;/a&gt;&amp;nbsp;, would you mind helping to clarify this answer?&amp;nbsp; I've tried everything I can think of to get it to work, but no luck so far (and this is something we'd like to do on other reports, so it would be widely used).&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The doc I attached is the one I've been using as a test to get that table displayed as needed.&amp;nbsp; The first table in there works great to summarize by tree condition, but still no luck with the By-Species table at the very end.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 21 Jun 2021 19:10:45 GMT</pubDate>
    <dc:creator>DerrickWestoby</dc:creator>
    <dc:date>2021-06-21T19:10:45Z</dc:date>
    <item>
      <title>Feature Report summary statistics / aggregate functions for orderBy with multiple filters</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/feature-report-summary-statistics-aggregate/m-p/1067415#M35200</link>
      <description>&lt;P&gt;Good Morning,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a Survey123 form for a Tree Inventory survey which contains a repeat (${#trees_repeat}).&amp;nbsp; Within the repeat, I have a field that lists the species of the tree ( ${tree} ) and the assessed condition of the tree ( ${condition} ), populated from a list with values like "poor", "fair", etc.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My feature report template includes a table listing every individual tree by ${tree_ID} that is working well:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DerrickWestoby_1-1623429454344.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/15759iB487A2D0DB34966D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="DerrickWestoby_1-1623429454344.png" alt="DerrickWestoby_1-1623429454344.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but I also need to create a summarized section with a count of condition ratings, grouped by species. Here is an example from the reports that are arborist are currently making manually, which is the goal I'm aiming for:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DerrickWestoby_0-1623429327035.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/15758i41CFB13640AFAF26/image-size/medium?v=v2&amp;amp;px=400" role="button" title="DerrickWestoby_0-1623429327035.png" alt="DerrickWestoby_0-1623429327035.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And this is as close as I've been able to get thus far (orderBy and the TreeCount for each species working as I want it to, but I'm not sure how to summarize the condition counts for each species in the table):&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DerrickWestoby_2-1623429622197.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/15760i52B307BCC34300DE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="DerrickWestoby_2-1623429622197.png" alt="DerrickWestoby_2-1623429622197.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The code I'm using in the feature report table to print out the repeat records sorted by species is:&amp;nbsp;&lt;/P&gt;&lt;P&gt;${#trees_repeat | stats:"count,objectid,TreeCount":"tree": "" | where:"1=1" | orderByFields:"tree ASC" }${tree}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And the whole table (including the counts by conditions for all the records in the repeats, not just the species)&amp;nbsp;&lt;/P&gt;&lt;TABLE width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="376"&gt;&lt;P&gt;&lt;STRONG&gt;Species&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD width="183"&gt;&lt;P&gt;&lt;STRONG&gt;Count&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD width="70"&gt;&lt;P&gt;&lt;STRONG&gt;Excellent&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD width="70"&gt;&lt;P&gt;&lt;STRONG&gt;Poor&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="376"&gt;&lt;P&gt;${#trees_repeat | stats:"count,objectid,TreeCount":"tree": "" | where:"1=1" | orderByFields:"tree ASC" }${tree}&lt;/P&gt;&lt;/TD&gt;&lt;TD width="183"&gt;&lt;P&gt;${TreeCount}&lt;/P&gt;&lt;/TD&gt;&lt;TD width="70"&gt;&lt;P&gt;${trees_repeat | where:"condition = 'excellent' " | stats:"count,objectid"}&lt;/P&gt;&lt;/TD&gt;&lt;TD width="70"&gt;&lt;P&gt;${trees_repeat | where:"condition = 'fair' " | stats:"count,objectid"}${/}&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If what I'm after is possible, I assume that I need to add in these other summaries to the code in the first column using multiple outStatistics parameters, but I haven't been able to figure out how to include a filter or where clause for just those specific outputs/results.&amp;nbsp; &amp;nbsp;I was thinking something like this (which doesn't work):&lt;/P&gt;&lt;P&gt;${#trees_repeat | stats:"count,objectid,TreeCount;count,condition='poor',PoorCount":"tree": "" | where:"1=1" | orderByFields:"tree ASC" }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated.&amp;nbsp; I've been using the help doc here as a reference, but haven't been able to make it work for my purposes -&amp;nbsp;&lt;A href="https://doc.arcgis.com/en/survey123/browser/analyze-results/featurereportqueries.htm" target="_blank"&gt;Report queries—ArcGIS Survey123 | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jun 2021 16:57:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/feature-report-summary-statistics-aggregate/m-p/1067415#M35200</guid>
      <dc:creator>DerrickWestoby</dc:creator>
      <dc:date>2021-06-11T16:57:28Z</dc:date>
    </item>
    <item>
      <title>Re: Feature Report summary statistics / aggregate functions for orderBy with multiple filters</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/feature-report-summary-statistics-aggregate/m-p/1068120#M35239</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/140205"&gt;@DerrickWestoby&lt;/a&gt; ,&lt;/P&gt;&lt;P&gt;Given your description, you should also be using a groupByFieldsForStatisitcs parameter with the tree field so that the counts are grouped by tree type.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jun 2021 20:44:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/feature-report-summary-statistics-aggregate/m-p/1068120#M35239</guid>
      <dc:creator>JamesTedrick</dc:creator>
      <dc:date>2021-06-14T20:44:29Z</dc:date>
    </item>
    <item>
      <title>Re: Feature Report summary statistics / aggregate functions for orderBy with multiple filters</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/feature-report-summary-statistics-aggregate/m-p/1068126#M35242</link>
      <description>&lt;P&gt;Hey James, thanks for the response.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you mean I should have something like this in the "Poor" column?&amp;nbsp;&lt;BR /&gt;${#trees_repeat | stats:"count,objectid,PoorCount":"tree": "" | where:"condition='poor'" | orderByFields:"tree ASC" }${PoorCount}&lt;BR /&gt;I thought I tried that last week, but maybe it was just a syntax error I was getting if so.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I'm way off, would you mind giving an example?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jun 2021 20:55:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/feature-report-summary-statistics-aggregate/m-p/1068126#M35242</guid>
      <dc:creator>DerrickWestoby</dc:creator>
      <dc:date>2021-06-14T20:55:20Z</dc:date>
    </item>
    <item>
      <title>Re: Feature Report summary statistics / aggregate functions for orderBy with multiple filters</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/feature-report-summary-statistics-aggregate/m-p/1070638#M35389</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1213"&gt;@JamesTedrick&lt;/a&gt;&amp;nbsp;, would you mind helping to clarify this answer?&amp;nbsp; I've tried everything I can think of to get it to work, but no luck so far (and this is something we'd like to do on other reports, so it would be widely used).&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The doc I attached is the one I've been using as a test to get that table displayed as needed.&amp;nbsp; The first table in there works great to summarize by tree condition, but still no luck with the By-Species table at the very end.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jun 2021 19:10:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/feature-report-summary-statistics-aggregate/m-p/1070638#M35389</guid>
      <dc:creator>DerrickWestoby</dc:creator>
      <dc:date>2021-06-21T19:10:45Z</dc:date>
    </item>
  </channel>
</rss>

