<?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 Arcade expression not behaving as expected in dashboard in ArcGIS Dashboards Questions</title>
    <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-expression-not-behaving-as-expected-in/m-p/1568124#M10562</link>
    <description>&lt;P&gt;We used Workflow Manager and have 2 workflow items with the same data and properties but different timeframes. I'm not a programmer but managed to create an arcade expression that combines information from both wmx items to consolidate data in a dashboard. The problem is that although the fields used in the arcade expression are the same as using just the table from 1 item, it behave different.&lt;/P&gt;&lt;P&gt;I used a sublayer from a hosted view in WMX to access extended properties fields. Our serial chart considered just distinct values when setting that parameter in the dashboard.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Screenshot 2024-12-12 170121.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/121640iA829704EB88C8C6B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2024-12-12 170121.png" alt="Screenshot 2024-12-12 170121.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When using the arcade expression and the data combined from the same fields the chart shows equal amount of values when the distinct setting is configured.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Screenshot 2024-12-12 170230.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/121641iDC62A5AA5EE4020E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2024-12-12 170230.png" alt="Screenshot 2024-12-12 170230.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Not setting the distinct parameter shows the correct pattern distribution but considering all records instead of just distinct values.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN&gt;Why the dashboard do not show the same for both data options? What modification to the expression needs to be made to ensure the expected behavior as with accessing only 1 sublayer?&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;The expression is...&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;var portal = Portal('&lt;A href="https://myPortal/portal" target="_blank"&gt;https://myPortal/portal&lt;/A&gt;');&lt;/P&gt;&lt;P&gt;var db1 = FeatureSetByPortalItem(portal, 'id_from_first_workflow', 8, ["job_id","job_name","created_date","job_status","closed","has_location","assigned_to","priority","end_date","extProp1_region","extProp2_adm_cierre","extProp2_adm_user"], false)&lt;/P&gt;&lt;P&gt;var db2 = FeatureSetByPortalItem(portal, 'id_from_second_workflow', 8, ["job_id","job_name","created_date","job_status","closed","has_location","assigned_to","priority","end_date","extProp1_region","extProp2_adm_cierre","extProp2_adm_user"], false)&lt;/P&gt;&lt;P&gt;var today_date = Today();&lt;/P&gt;&lt;P&gt;var features = [];&lt;BR /&gt;var feat;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;for (var f1 in db1) {&lt;BR /&gt;feat = {&lt;BR /&gt;attributes: {&lt;BR /&gt;flujo: '1',&lt;BR /&gt;jobid: f1['job_id'],&lt;BR /&gt;jobname: f1['job_name'],&lt;BR /&gt;jobstatus: f1['job_status'],&lt;BR /&gt;closed: f1['closed'],&lt;BR /&gt;assigned_to: f1['assigned_to'],&lt;BR /&gt;priority: f1['priority'],&lt;BR /&gt;region: f1['extProp1_region'],&lt;BR /&gt;adm_cierre: f1['extProp2_adm_cierre'],&lt;BR /&gt;adm_user: f1['extProp2_adm_user'],&lt;BR /&gt;date_start: Number(f1['created_date']),&lt;BR /&gt;haslocation: f1['has_location'],&lt;BR /&gt;date_end: Number(f1['end_date']),&lt;BR /&gt;openDuration: abs(round(DateDiff(today_date,f1['created_date'],'days'),0)),&lt;BR /&gt;closeDuration: abs(round(DateDiff(f1['end_date'],f1['created_date'],'days'),0))&lt;BR /&gt;},&lt;BR /&gt;};&lt;BR /&gt;Push(features, feat);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;for (var f2 in db2) {&lt;BR /&gt;feat = {&lt;BR /&gt;attributes: {&lt;BR /&gt;flujo: '2',&lt;BR /&gt;jobid: f2['job_id'],&lt;BR /&gt;jobname: f2['job_name'],&lt;BR /&gt;jobstatus: f2['job_status'],&lt;BR /&gt;closed: f2['closed'],&lt;BR /&gt;assigned_to: f2['assigned_to'],&lt;BR /&gt;priority: f2['priority'],&lt;BR /&gt;region: f2['extProp1_region'],&lt;BR /&gt;adm_cierre: f2['extProp2_adm_cierre'],&lt;BR /&gt;adm_user: f2['extProp2_adm_user'],&lt;BR /&gt;date_start: Number(f2['created_date']),&lt;BR /&gt;haslocation: f2['has_location'],&lt;BR /&gt;date_end: Number(f2['end_date']),&lt;BR /&gt;openDuration: abs(round(DateDiff(today_date,f2['created_date'],'days'),0)),&lt;BR /&gt;closeDuration: abs(round(DateDiff(f2['end_date'],f2['created_date'],'days'),0))&lt;BR /&gt;},&lt;BR /&gt;};&lt;BR /&gt;Push(features, feat);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;var combinedDict = {&lt;BR /&gt;fields: [&lt;BR /&gt;{name: 'flujo', type: 'esriFieldTypeString' },&lt;BR /&gt;{name: 'jobid', type: 'esriFieldTypeString'},&lt;BR /&gt;{name: 'jobname', type: 'esriFieldTypeString'},&lt;BR /&gt;{name: 'jobstatus', type: 'esriFieldTypeString'},&lt;BR /&gt;{name: 'assigned_to', type: 'esriFieldTypeString'},&lt;BR /&gt;{name: 'priority', type: 'esriFieldTypeString'},&lt;BR /&gt;{name: 'closed', type: 'esriFieldTypeString'},&lt;BR /&gt;{name: 'date_start', type: 'esriFieldTypeDate'},&lt;BR /&gt;{name: 'haslocation', type: 'esriFieldTypeString'},&lt;BR /&gt;{name: 'adm_cierre', type: 'esriFieldTypeString'},&lt;BR /&gt;{name: 'adm_user', type: 'esriFieldTypeString'},&lt;BR /&gt;{name: 'date_end', type: 'esriFieldTypeDate'},&lt;BR /&gt;{name: 'openDuration', type: 'esriFieldTypeDouble'},&lt;BR /&gt;{name: 'closeDuration', type: 'esriFieldTypeDouble'},&lt;BR /&gt;{name: 'region', 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(combinedDict));&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Any help or suggestions are welcome.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;</description>
    <pubDate>Thu, 12 Dec 2024 21:07:34 GMT</pubDate>
    <dc:creator>Ulises</dc:creator>
    <dc:date>2024-12-12T21:07:34Z</dc:date>
    <item>
      <title>Arcade expression not behaving as expected in dashboard</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-expression-not-behaving-as-expected-in/m-p/1568124#M10562</link>
      <description>&lt;P&gt;We used Workflow Manager and have 2 workflow items with the same data and properties but different timeframes. I'm not a programmer but managed to create an arcade expression that combines information from both wmx items to consolidate data in a dashboard. The problem is that although the fields used in the arcade expression are the same as using just the table from 1 item, it behave different.&lt;/P&gt;&lt;P&gt;I used a sublayer from a hosted view in WMX to access extended properties fields. Our serial chart considered just distinct values when setting that parameter in the dashboard.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Screenshot 2024-12-12 170121.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/121640iA829704EB88C8C6B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2024-12-12 170121.png" alt="Screenshot 2024-12-12 170121.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When using the arcade expression and the data combined from the same fields the chart shows equal amount of values when the distinct setting is configured.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Screenshot 2024-12-12 170230.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/121641iDC62A5AA5EE4020E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2024-12-12 170230.png" alt="Screenshot 2024-12-12 170230.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Not setting the distinct parameter shows the correct pattern distribution but considering all records instead of just distinct values.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN&gt;Why the dashboard do not show the same for both data options? What modification to the expression needs to be made to ensure the expected behavior as with accessing only 1 sublayer?&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;The expression is...&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;var portal = Portal('&lt;A href="https://myPortal/portal" target="_blank"&gt;https://myPortal/portal&lt;/A&gt;');&lt;/P&gt;&lt;P&gt;var db1 = FeatureSetByPortalItem(portal, 'id_from_first_workflow', 8, ["job_id","job_name","created_date","job_status","closed","has_location","assigned_to","priority","end_date","extProp1_region","extProp2_adm_cierre","extProp2_adm_user"], false)&lt;/P&gt;&lt;P&gt;var db2 = FeatureSetByPortalItem(portal, 'id_from_second_workflow', 8, ["job_id","job_name","created_date","job_status","closed","has_location","assigned_to","priority","end_date","extProp1_region","extProp2_adm_cierre","extProp2_adm_user"], false)&lt;/P&gt;&lt;P&gt;var today_date = Today();&lt;/P&gt;&lt;P&gt;var features = [];&lt;BR /&gt;var feat;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;for (var f1 in db1) {&lt;BR /&gt;feat = {&lt;BR /&gt;attributes: {&lt;BR /&gt;flujo: '1',&lt;BR /&gt;jobid: f1['job_id'],&lt;BR /&gt;jobname: f1['job_name'],&lt;BR /&gt;jobstatus: f1['job_status'],&lt;BR /&gt;closed: f1['closed'],&lt;BR /&gt;assigned_to: f1['assigned_to'],&lt;BR /&gt;priority: f1['priority'],&lt;BR /&gt;region: f1['extProp1_region'],&lt;BR /&gt;adm_cierre: f1['extProp2_adm_cierre'],&lt;BR /&gt;adm_user: f1['extProp2_adm_user'],&lt;BR /&gt;date_start: Number(f1['created_date']),&lt;BR /&gt;haslocation: f1['has_location'],&lt;BR /&gt;date_end: Number(f1['end_date']),&lt;BR /&gt;openDuration: abs(round(DateDiff(today_date,f1['created_date'],'days'),0)),&lt;BR /&gt;closeDuration: abs(round(DateDiff(f1['end_date'],f1['created_date'],'days'),0))&lt;BR /&gt;},&lt;BR /&gt;};&lt;BR /&gt;Push(features, feat);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;for (var f2 in db2) {&lt;BR /&gt;feat = {&lt;BR /&gt;attributes: {&lt;BR /&gt;flujo: '2',&lt;BR /&gt;jobid: f2['job_id'],&lt;BR /&gt;jobname: f2['job_name'],&lt;BR /&gt;jobstatus: f2['job_status'],&lt;BR /&gt;closed: f2['closed'],&lt;BR /&gt;assigned_to: f2['assigned_to'],&lt;BR /&gt;priority: f2['priority'],&lt;BR /&gt;region: f2['extProp1_region'],&lt;BR /&gt;adm_cierre: f2['extProp2_adm_cierre'],&lt;BR /&gt;adm_user: f2['extProp2_adm_user'],&lt;BR /&gt;date_start: Number(f2['created_date']),&lt;BR /&gt;haslocation: f2['has_location'],&lt;BR /&gt;date_end: Number(f2['end_date']),&lt;BR /&gt;openDuration: abs(round(DateDiff(today_date,f2['created_date'],'days'),0)),&lt;BR /&gt;closeDuration: abs(round(DateDiff(f2['end_date'],f2['created_date'],'days'),0))&lt;BR /&gt;},&lt;BR /&gt;};&lt;BR /&gt;Push(features, feat);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;var combinedDict = {&lt;BR /&gt;fields: [&lt;BR /&gt;{name: 'flujo', type: 'esriFieldTypeString' },&lt;BR /&gt;{name: 'jobid', type: 'esriFieldTypeString'},&lt;BR /&gt;{name: 'jobname', type: 'esriFieldTypeString'},&lt;BR /&gt;{name: 'jobstatus', type: 'esriFieldTypeString'},&lt;BR /&gt;{name: 'assigned_to', type: 'esriFieldTypeString'},&lt;BR /&gt;{name: 'priority', type: 'esriFieldTypeString'},&lt;BR /&gt;{name: 'closed', type: 'esriFieldTypeString'},&lt;BR /&gt;{name: 'date_start', type: 'esriFieldTypeDate'},&lt;BR /&gt;{name: 'haslocation', type: 'esriFieldTypeString'},&lt;BR /&gt;{name: 'adm_cierre', type: 'esriFieldTypeString'},&lt;BR /&gt;{name: 'adm_user', type: 'esriFieldTypeString'},&lt;BR /&gt;{name: 'date_end', type: 'esriFieldTypeDate'},&lt;BR /&gt;{name: 'openDuration', type: 'esriFieldTypeDouble'},&lt;BR /&gt;{name: 'closeDuration', type: 'esriFieldTypeDouble'},&lt;BR /&gt;{name: 'region', 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(combinedDict));&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Any help or suggestions are welcome.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2024 21:07:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-expression-not-behaving-as-expected-in/m-p/1568124#M10562</guid>
      <dc:creator>Ulises</dc:creator>
      <dc:date>2024-12-12T21:07:34Z</dc:date>
    </item>
  </channel>
</rss>

