<?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: Loop through query results  and pass in the numbers to another query where clause in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/loop-through-query-results-nbsp-and-pass-in-the/m-p/298592#M27411</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I face a similar challenge as you, although I am one step behind.&amp;nbsp; Can you share with me the code for selecting multiple points?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 23 Jun 2014 15:27:45 GMT</pubDate>
    <dc:creator>EdwardGlover</dc:creator>
    <dc:date>2014-06-23T15:27:45Z</dc:date>
    <item>
      <title>Loop through query results  and pass in the numbers to another query where clause</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/loop-through-query-results-nbsp-and-pass-in-the/m-p/298591#M27410</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am a novice javascript programmer. I have my site working very well now to do most everything I want. I am stuck on the last couple pieces though. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a select button working where a user clicks the button then draws around an area to highlight points. These points then sum up a total amount and displays this total amount to the user. This part works great.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Where I am stuck is that I want to take the regions that these points fall within and then subtract that total from the whole regions total. So for instance:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;A region might have 100 points which total $10,000...another region might have 50 points that total $5,000...If a user selects points from region A and region B then I want to pass back to the user the total of the new region and the new totals of region A and region B. As a test in my code I am passing back the region ID to the user currently&amp;nbsp; just to see if everything is working. I am only getting one region ID back though if the user selects points from multiple regions. How do I get all of the region ID's to come back? And then in turn after I get the region id's how do I do the other calculation on the fly? Below is my code for the function that sums the points selected and displays that value and just one region id. Thanks in advance!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;// Sum Accounts Function
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; function sumAccounts(features) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var imputedSum = 0;
&amp;nbsp;&amp;nbsp;&amp;nbsp; var regionSSO;
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dojo.forEach(features, function(feature) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; imputedSum = imputedSum + feature.attributes.F80_Q_num;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; regionSSO = feature.attributes.EMPLOYEENUMBER;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var formattedImputedSum = dojo.number.format(imputedSum)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dojo.byId('messages').innerHTML = "Total 80Q Accounts: $" + formattedImputedSum + "";
&amp;nbsp;&amp;nbsp;&amp;nbsp; dojo.byId('messages2').innerHTML = "Rep SSO: " + regionSSO + "";
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp; &lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 07 Jun 2014 00:27:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/loop-through-query-results-nbsp-and-pass-in-the/m-p/298591#M27410</guid>
      <dc:creator>DaveTaylor</dc:creator>
      <dc:date>2014-06-07T00:27:20Z</dc:date>
    </item>
    <item>
      <title>Re: Loop through query results  and pass in the numbers to another query where clause</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/loop-through-query-results-nbsp-and-pass-in-the/m-p/298592#M27411</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I face a similar challenge as you, although I am one step behind.&amp;nbsp; Can you share with me the code for selecting multiple points?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jun 2014 15:27:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/loop-through-query-results-nbsp-and-pass-in-the/m-p/298592#M27411</guid>
      <dc:creator>EdwardGlover</dc:creator>
      <dc:date>2014-06-23T15:27:45Z</dc:date>
    </item>
  </channel>
</rss>

