<?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: CIP Coordination Solution - Project Expenditures Arcade Expression in ArcGIS Solutions Questions</title>
    <link>https://community.esri.com/t5/arcgis-solutions-questions/cip-coordination-solution-project-expenditures/m-p/1661298#M1860</link>
    <description>&lt;P&gt;Hi Josh,&lt;/P&gt;&lt;P&gt;I'm running into some limitations on my actcost field calculations &lt;A href="https://community.esri.com/t5/arcgis-solutions-questions/cpc-capital-project-coordination-solution-related/m-p/1661292#M1859" target="_self"&gt;CPC (Capital Project Coordination) Solution Related Table(s) Limitations?&lt;/A&gt;. Do you mind sharing if you're also running into this issue? Attempting to troubleshoot at the moment if it's a function or table limitation. Thanks!&lt;/P&gt;</description>
    <pubDate>Tue, 28 Oct 2025 13:29:34 GMT</pubDate>
    <dc:creator>LeahBowyer</dc:creator>
    <dc:date>2025-10-28T13:29:34Z</dc:date>
    <item>
      <title>CIP Coordination Solution - Project Expenditures Arcade Expression</title>
      <link>https://community.esri.com/t5/arcgis-solutions-questions/cip-coordination-solution-project-expenditures/m-p/1621628#M1765</link>
      <description>&lt;P&gt;I was wondering if something was broken in our solution setup or if we are using the "Spending" related table in the way the application is configured.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The arcade expression built does not total the expenditures in the pop-up, from what I can tell... The bar representing "Expenditures to date:" does not represent the total of all expenditures (Spending related table). I've copied the arcade expression I believe needs to be adjusted, but I'm not confident enough in my Arcade to edit and risk reconfiguring the solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this ISN'T intended to be used with multiple entries for expenditure, are there ways to configure to support? We would like to use this related table to note contract pay outs categorized by design phase (category field) / vendor (description).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LeahBowyer_1-1749236065628.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/133940i877FEA4C337EB14A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LeahBowyer_1-1749236065628.png" alt="LeahBowyer_1-1749236065628.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;LI-CODE lang="javascript"&gt;//colors
var estCostColor ='#00734C'

//budget values
var expendituresFS = FeatureSetByRelationshipName($feature, 'Spending');
var mostRecentExpend = first(OrderBy(expendituresFS, 'datespent DESC'));
var actcost = IIF(IsEmpty(mostRecentExpend), 0, mostRecentExpend.costamount);

var estCost = $feature.estcost;
var totalSpending = 0+ actcost
var budgetRemaining = estcost-actcost

//labels
var formattedCost = text(estCost, '$#,###')
var formattedBudgetRemaining = text(budgetRemaining, '$#,###');
var formattedSpent = Text(totalSpending, "$#,###")

//bar width % values
var fullwidth = estCost;
var costWidth = (estCost / fullwidth)*100;
var spentWidth = (totalSpending/fullwidth) *100
var remainingwidth = (budgetRemaining/fullwidth)*100


var b1
var b2
var b3
var spentDisplay

if(totalSpending &amp;gt; estCost){
  //Money Spent over budget
  if(totalSpending &amp;gt; fullwidth){
    spentDisplay = `&amp;lt;td style="background-color:#C12E00;width:${costWidth}%; border-right: 3px solid black"  title="Spent: ${formattedCost}"&amp;gt;&amp;lt;/td&amp;gt;`
   
    b1 = `${costWidth}%;border-right:3px solid black`
   



  }else{
    //Money Spent Over budget
   
    spentDisplay = `&amp;lt;td style="background-color:${estCostColor};width:${costWidth}%"  title="Spent: ${formattedCost}"&amp;gt;&amp;lt;/td&amp;gt;`

    b1 = `${costWidth}%`
  }

}else{
    if(totalSpending == 0 || IsEmpty(totalSpending)){
    //No Money spent
      spentDisplay = `&amp;lt;td style="background-color:${estCostColor};width:${costWidth}%;"  title="Remaining: ${formattedCost}"&amp;gt;&amp;lt;/td&amp;gt;`
    }else{
    //Money Spent, not over budget
      spentDisplay = `&amp;lt;td style="background-color:#C12E00;width:${spentWidth}%;border-right: 3px solid black"  title="Spent: ${formattedSpent}"&amp;gt;&amp;lt;/td&amp;gt;
            &amp;lt;td style="background-color:${estCostColor};width:${remainingwidth}%;"  title="Remaining: ${formattedBudgetRemaining}"&amp;gt;&amp;lt;/td&amp;gt;`
      b1 = `${spentWidth}%;border-right: 3px solid black`
      b2 = `${remainingwidth}%`
    }
}


var final = {type : 'text',
text :`&amp;lt;font style="font-size:18px;color:#000000"&amp;gt;&amp;lt;b&amp;gt;Estimated budget:&amp;lt;/b&amp;gt; ${formattedCost}&amp;lt;/font&amp;gt;&amp;lt;/br&amp;gt;
&amp;lt;font style="font-size:18px;"&amp;gt;&amp;lt;b&amp;gt;Expenditures to date:&amp;lt;/b&amp;gt; ${formattedSpent}&amp;lt;/font&amp;gt;&amp;lt;/br&amp;gt;
&amp;lt;table style="width:100%;border-collapse:collapse"&amp;gt;
  &amp;lt;tr style="height:10px"&amp;gt;
    &amp;lt;td style="background-color:white;width:${b1}"&amp;gt;&amp;lt;/td&amp;gt;
    &amp;lt;td style="background-color:white;width:${b2}"&amp;gt;&amp;lt;/td&amp;gt;
    &amp;lt;td style="background-color:white;width:${b3}"&amp;gt;&amp;lt;/td&amp;gt;
  &amp;lt;/tr&amp;gt;
  &amp;lt;tr style="height:25px"&amp;gt;
    ${spentDisplay}
  &amp;lt;/tr&amp;gt;
  &amp;lt;tr style="height:10px"&amp;gt;
    &amp;lt;td style="background-color:white;width:${b1}"&amp;gt;&amp;lt;/td&amp;gt;
    &amp;lt;td style="background-color:white;width:${b2}"&amp;gt;&amp;lt;/td&amp;gt;
    &amp;lt;td style="background-color:white;width:${b3}"&amp;gt;&amp;lt;/td&amp;gt;

  &amp;lt;/tr&amp;gt;
&amp;lt;/table&amp;gt;`
}

return final&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 06 Jun 2025 20:39:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-solutions-questions/cip-coordination-solution-project-expenditures/m-p/1621628#M1765</guid>
      <dc:creator>LeahBowyer</dc:creator>
      <dc:date>2025-06-06T20:39:12Z</dc:date>
    </item>
    <item>
      <title>Re: CIP Coordination Solution - Project Expenditures Arcade Expression</title>
      <link>https://community.esri.com/t5/arcgis-solutions-questions/cip-coordination-solution-project-expenditures/m-p/1621643#M1766</link>
      <description>&lt;P&gt;It looks like you'd just need to get the sum of the costamounts field in expendituresFS instead of using the most recent expenditure record.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;//budget values
var expendituresFS = FeatureSetByRelationshipName($feature, "Spending");
var actcost = Sum(expendituresFS , 'costamount')

var estCost = $feature.estcost;
var totalSpending = 0+ actcost //not sure why you need "0+" in this line 
var budgetRemaining = estcost-actcost&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;If you're going to post code, please use the &lt;A href="https://community.esri.com/t5/python-blog/code-formatting-the-community-version/ba-p/1007633#U1007633" target="_self"&gt;Insert/Edit code sample&lt;/A&gt; button&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jun 2025 19:53:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-solutions-questions/cip-coordination-solution-project-expenditures/m-p/1621643#M1766</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2025-06-06T19:53:50Z</dc:date>
    </item>
    <item>
      <title>Re: CIP Coordination Solution - Project Expenditures Arcade Expression</title>
      <link>https://community.esri.com/t5/arcgis-solutions-questions/cip-coordination-solution-project-expenditures/m-p/1621654#M1767</link>
      <description>&lt;P&gt;Thank you,&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/2839"&gt;@KenBuja&lt;/a&gt;.&amp;nbsp;I will try your suggestion.&lt;/P&gt;&lt;P&gt;RE: Code Comments. This code was created as part of the ArcGIS Solution by their team, so I'm not sure of the origin or purpose.&lt;/P&gt;&lt;P&gt;I didn't see Arcade as an option in the code insert. What language option would you suggest I use?&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jun 2025 20:24:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-solutions-questions/cip-coordination-solution-project-expenditures/m-p/1621654#M1767</guid>
      <dc:creator>LeahBowyer</dc:creator>
      <dc:date>2025-06-06T20:24:34Z</dc:date>
    </item>
    <item>
      <title>Re: CIP Coordination Solution - Project Expenditures Arcade Expression</title>
      <link>https://community.esri.com/t5/arcgis-solutions-questions/cip-coordination-solution-project-expenditures/m-p/1621659#M1768</link>
      <description>&lt;P&gt;Use Javascript, since Arcade is based on that language.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jun 2025 20:32:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-solutions-questions/cip-coordination-solution-project-expenditures/m-p/1621659#M1768</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2025-06-06T20:32:03Z</dc:date>
    </item>
    <item>
      <title>Re: CIP Coordination Solution - Project Expenditures Arcade Expression</title>
      <link>https://community.esri.com/t5/arcgis-solutions-questions/cip-coordination-solution-project-expenditures/m-p/1621817#M1769</link>
      <description>&lt;P&gt;We are working through implementing this solution as well, and we also found that the way the solution is designed to work is you enter the running total in the spending table each time you have a payout. We did not want it to work that way either and you have to change the actcost to use the Sum function in each of the different maps that has the Spending/Expenditures information.&lt;/P&gt;&lt;P&gt;You can also update the embedded HTML in Arcade to update the table element to show the category field. Here is one example from the Capital Project Tracker web map.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;if (count(related)&amp;gt;0){

  final = `&amp;lt;span style="font-size:18px;"&amp;gt;&amp;lt;b&amp;gt;Expenditures&amp;lt;/b&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&amp;lt;table style="width:100%;border-spacing: .5rem;"&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&amp;lt;table style="width:100%;border-collapse: collapse;"&amp;gt; 
  &amp;lt;tr style="border-collapse: collapse; font-size:15px;"&amp;gt;&amp;lt;th style="text-align:left;width:30%"&amp;gt;Date&amp;lt;/th&amp;gt;&amp;lt;th style="text-align:center"&amp;gt;Category&amp;lt;/th&amp;gt;&amp;lt;th style="text-align:right"&amp;gt;Amount&amp;lt;/th&amp;gt;&amp;lt;/tr&amp;gt;
  `
  var counter =0
  var x = 0
  for (var i in related) {
      var amount = Text(i.costamount,'###,###,###')
      var color = iif(x % 2==0,"#D6D6D6","#FFFFFF")
      var spentDate = text(i.datespent, "MM/DD/YYYY")
      var category = i.category
      final += `&amp;lt;tr style="border-collapse: collapse;"&amp;gt;&amp;lt;td style="text-align:left;width:30%;background-color:${color}"&amp;gt;${spentDate}&amp;lt;/td&amp;gt;&amp;lt;td style="text-align:center;background-color:${color}"&amp;gt;${category}&amp;lt;/td&amp;gt;&amp;lt;td style="text-align:right;background-color:${color}"&amp;gt;$${amount}&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;`
      x++
      counter++
  }
  final += '&amp;lt;/table&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;';
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jun 2025 13:46:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-solutions-questions/cip-coordination-solution-project-expenditures/m-p/1621817#M1769</guid>
      <dc:creator>Joshua-Young</dc:creator>
      <dc:date>2025-06-09T13:46:42Z</dc:date>
    </item>
    <item>
      <title>Re: CIP Coordination Solution - Project Expenditures Arcade Expression</title>
      <link>https://community.esri.com/t5/arcgis-solutions-questions/cip-coordination-solution-project-expenditures/m-p/1621820#M1770</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/289902"&gt;@LeahBowyer&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;As designed, the Cap Project Coordination Solution is configured to store and return the total expenditures to date, rather than individual pay requests. We configured it in this way for simplicity, but the Solution can certainly be extended to track individual expenditures/pay requests. Based on the comments, you're on your way to doing just that.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jun 2025 13:49:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-solutions-questions/cip-coordination-solution-project-expenditures/m-p/1621820#M1770</guid>
      <dc:creator>MikeDagle</dc:creator>
      <dc:date>2025-06-09T13:49:44Z</dc:date>
    </item>
    <item>
      <title>Re: CIP Coordination Solution - Project Expenditures Arcade Expression</title>
      <link>https://community.esri.com/t5/arcgis-solutions-questions/cip-coordination-solution-project-expenditures/m-p/1621823#M1771</link>
      <description>&lt;P&gt;This is great feedback,&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/313283"&gt;@Joshua-Young&lt;/a&gt;&amp;nbsp;!&lt;BR /&gt;&lt;BR /&gt;I might ping you if I come across any other oddities. I'm trying my best to breadcrumb my way through these changes so I can reproduce or edit in the future without too much confusion.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jun 2025 14:00:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-solutions-questions/cip-coordination-solution-project-expenditures/m-p/1621823#M1771</guid>
      <dc:creator>LeahBowyer</dc:creator>
      <dc:date>2025-06-09T14:00:01Z</dc:date>
    </item>
    <item>
      <title>Re: CIP Coordination Solution - Project Expenditures Arcade Expression</title>
      <link>https://community.esri.com/t5/arcgis-solutions-questions/cip-coordination-solution-project-expenditures/m-p/1661298#M1860</link>
      <description>&lt;P&gt;Hi Josh,&lt;/P&gt;&lt;P&gt;I'm running into some limitations on my actcost field calculations &lt;A href="https://community.esri.com/t5/arcgis-solutions-questions/cpc-capital-project-coordination-solution-related/m-p/1661292#M1859" target="_self"&gt;CPC (Capital Project Coordination) Solution Related Table(s) Limitations?&lt;/A&gt;. Do you mind sharing if you're also running into this issue? Attempting to troubleshoot at the moment if it's a function or table limitation. Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 28 Oct 2025 13:29:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-solutions-questions/cip-coordination-solution-project-expenditures/m-p/1661298#M1860</guid>
      <dc:creator>LeahBowyer</dc:creator>
      <dc:date>2025-10-28T13:29:34Z</dc:date>
    </item>
  </channel>
</rss>

