<?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: Arcade Script to join table to point Layer for pie chart ERROR in ArcGIS Dashboards Questions</title>
    <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-script-to-join-table-to-point-layer-for-pie/m-p/1501819#M9927</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for responding. Line 40 is the last line '&lt;SPAN&gt;return FeatureSet(joinedDict);'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Alice&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 05 Jul 2024 13:59:01 GMT</pubDate>
    <dc:creator>ALICEANSTEE</dc:creator>
    <dc:date>2024-07-05T13:59:01Z</dc:date>
    <item>
      <title>Arcade Script to join table to point Layer for pie chart ERROR</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-script-to-join-table-to-point-layer-for-pie/m-p/1501545#M9920</link>
      <description>&lt;P&gt;Hi. I am currently trying to join a table to a point hosted layer to display additional fields in a pie chart in dashboard. My current script ( I used a little of it from GitHub) doesnt show any errors in the actual script but comes up with this error :&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Expected "!=", "(", "*", "+", "-", "/", "&amp;lt;", "&amp;lt;=", "&amp;lt;&amp;gt;", "=", "&amp;gt;", "&amp;gt;=", "AND", "OR", [ \t\n\r], or end of input but "5" found.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Does anyone know where the errors lies? I can't locate any wrong syntax so thinking it may be another issue? My script is below (pointfs is the feature set and tablefs is the table I want to join to - based on a common attribute that holds Postcodes (PostcodeSector)) :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(I've removed the portal link at the top for privacy).&amp;nbsp;&lt;/P&gt;&lt;P&gt;var portal_Link = Portal('xyz');&lt;BR /&gt;var pointfs = FeatureSetByPortalItem(portal_Link,'17d25668c1ee4904ac2920558175f291',0,["*"], false);&lt;BR /&gt;var tablefs = FeatureSetByPortalItem(portal_Link,'76a135fad8db4da7bc2932ec7c58dd5b',0,["*"], false);&lt;/P&gt;&lt;P&gt;var features = [];&lt;BR /&gt;var feat;&lt;/P&gt;&lt;P&gt;for (var t in tablefs){&lt;BR /&gt;var tableID = t["user_postsector"]&lt;BR /&gt;for (var p in Filter(pointfs, "Postcode_Sector= "+tableID)){&lt;BR /&gt;feat = {&lt;BR /&gt;attributes: {&lt;BR /&gt;organisation: tableID,&lt;BR /&gt;PostcodeSectorAv: p["user_postcodesectoraverage"],&lt;BR /&gt;PostcodeSectorCount: p["user_postsectorcountvalued"],&lt;BR /&gt;GSS_CODE: t["GSS_CODE"]&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;Push(features, feat)&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;var joinedDict = {&lt;BR /&gt;field: [&lt;BR /&gt;{name: "organisation", type: "esriFieldTypeString"},&lt;BR /&gt;{name: "PostcodeSectorAv,", type: "esriFieldTypeInteger"},&lt;BR /&gt;{name: "PostcodeSectorCount", type: "esriFieldTypeInteger"},&lt;BR /&gt;{name: "GSS_CODE", type: "esriFieldTypeString"},&lt;BR /&gt;],&lt;BR /&gt;'geometryType': '',&lt;BR /&gt;'features':features&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;return FeatureSet(Text(JoinedDict));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jul 2024 14:04:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-script-to-join-table-to-point-layer-for-pie/m-p/1501545#M9920</guid>
      <dc:creator>ALICEANSTEE</dc:creator>
      <dc:date>2024-07-04T14:04:52Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Script to join table to point Layer for pie chart ERROR</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-script-to-join-table-to-point-layer-for-pie/m-p/1501558#M9921</link>
      <description>&lt;P&gt;That error comes from a SQL statement, which in this expression, is your &lt;STRONG&gt;Filter&lt;/STRONG&gt; function.&lt;/P&gt;&lt;P&gt;Generally, functions that use a SQL expression with a dynamic value, like your table ID, should reference the value in one of two ways.&lt;/P&gt;&lt;P&gt;One is to establish the variable, then use &lt;STRONG&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/696824"&gt;@Variable80&lt;/a&gt;_name&lt;/STRONG&gt; in the SQL string:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var tableID = t['user_postsector']
for (var p in Filter(pointfs, "Postcode_Sector=@tableID")) {
  …
}&lt;/LI-CODE&gt;&lt;P&gt;The other is to use a &lt;EM&gt;template literal&lt;/EM&gt;. I particularly like this approach myself, as you don't need to create a variable just for one thing.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;for (var p in Filter(pointfs, `Postcode_Sector=${t['user_postsector']}`)) {
  …
}&lt;/LI-CODE&gt;&lt;P&gt;See if either of those help.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jul 2024 14:46:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-script-to-join-table-to-point-layer-for-pie/m-p/1501558#M9921</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2024-07-04T14:46:11Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Script to join table to point Layer for pie chart ERROR</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-script-to-join-table-to-point-layer-for-pie/m-p/1501760#M9923</link>
      <description>&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks thats helped move past the SQL error - appreciate the help. I am now getting this error:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Execution error - Line : 44, 7: Invalid parameter&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I've tried to get distinct values in a new subset of the house price estimations per postcode sector to try and make the script quicker - I'm not sure if this is then causing an error or if its because the output is a dictionary? I get the same output when I end the script with : return FeatureSet(Text(joinedDict))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any additional help would be great!&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var portal_Link = Portal('xyzx');&lt;BR /&gt;var pointfs = FeatureSetByPortalItem(portal_Link,'17d25668c1ee4904ac2920558175f291',0,["*"], false);&lt;BR /&gt;var tablefs = FeatureSetByPortalItem(portal_Link,'76a135fad8db4da7bc2932ec7c58dd5b',0,["*"], false);&lt;/P&gt;&lt;P&gt;var fields = ["user_postsector", "user_postcodesectoraverage", "user_postsectorcountvalued"];&lt;BR /&gt;var DistinctTablefs = Distinct(tablefs, fields)&lt;/P&gt;&lt;P&gt;var features = [];&lt;BR /&gt;var feat;&lt;/P&gt;&lt;P&gt;for (var t in DistinctTablefs){&lt;BR /&gt;var tableID = t["user_postsector"]&lt;BR /&gt;for (var p in Filter(pointfs, "organisation=@tableID")){&lt;BR /&gt;feat = {&lt;BR /&gt;attributes: {&lt;BR /&gt;organisation: tableID,&lt;BR /&gt;PostcodeSectorAv: t["user_postcodesectoraverage"],&lt;BR /&gt;PostcodeSectorCount: t["user_postsectorcountvalued"],&lt;BR /&gt;GSS_CODE: p["GSS_CODE"]&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;Push(features, feat)&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;var joinedDict = {&lt;BR /&gt;field: [&lt;BR /&gt;{name: "organisation", type: "esriFieldTypeString"},&lt;BR /&gt;{name: "PostcodeSectorAv,", type: "esriFieldTypeInteger"},&lt;BR /&gt;{name: "PostcodeSectorCount", type: "esriFieldTypeInteger"},&lt;BR /&gt;{name: "GSS_CODE", type: "esriFieldTypeString"},&lt;BR /&gt;],&lt;BR /&gt;'geometryType': '',&lt;BR /&gt;'features':features&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;return FeatureSet(joinedDict);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jul 2024 08:54:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-script-to-join-table-to-point-layer-for-pie/m-p/1501760#M9923</guid>
      <dc:creator>ALICEANSTEE</dc:creator>
      <dc:date>2024-07-05T08:54:39Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Script to join table to point Layer for pie chart ERROR</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-script-to-join-table-to-point-layer-for-pie/m-p/1501769#M9924</link>
      <description>&lt;P&gt;Update as of 05/07/2024. I've check the return of the features just before the creation of the var joinedDict and it returns the multiple dictionaries with a correct join (fab!). I've now been trying to merge the dictionaries together to create one.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ALICEANSTEE_0-1720175804608.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/108881i5C7E9DE19604727B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ALICEANSTEE_0-1720175804608.png" alt="ALICEANSTEE_0-1720175804608.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;This is one of the individual dictionaries:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ALICEANSTEE_1-1720175830665.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/108882i9C976E6B4288EC54/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ALICEANSTEE_1-1720175830665.png" alt="ALICEANSTEE_1-1720175830665.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;any ideas on how best to do this? I assumed iterating through each would be best?&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jul 2024 10:37:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-script-to-join-table-to-point-layer-for-pie/m-p/1501769#M9924</guid>
      <dc:creator>ALICEANSTEE</dc:creator>
      <dc:date>2024-07-05T10:37:33Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Script to join table to point Layer for pie chart ERROR</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-script-to-join-table-to-point-layer-for-pie/m-p/1501813#M9926</link>
      <description>&lt;P&gt;In your &lt;STRONG&gt;joinedDict&lt;/STRONG&gt; object, you have a key "field". That should be "fields".&lt;/P&gt;&lt;P&gt;I can't tell from your post which line of your code is line 44, so I don't know what parameter your expression might be referencing.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jul 2024 13:41:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-script-to-join-table-to-point-layer-for-pie/m-p/1501813#M9926</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2024-07-05T13:41:23Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Script to join table to point Layer for pie chart ERROR</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-script-to-join-table-to-point-layer-for-pie/m-p/1501819#M9927</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for responding. Line 40 is the last line '&lt;SPAN&gt;return FeatureSet(joinedDict);'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Alice&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jul 2024 13:59:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-script-to-join-table-to-point-layer-for-pie/m-p/1501819#M9927</guid>
      <dc:creator>ALICEANSTEE</dc:creator>
      <dc:date>2024-07-05T13:59:01Z</dc:date>
    </item>
  </channel>
</rss>

