<?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: Calculation based on select-one results in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/calculation-based-on-select-one-results/m-p/877379#M29626</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Bill,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In general, I think it would be more efficient/sustainable to do this with a pulldata() function using a csv lookup. &amp;nbsp;That being said, you may be able to do this if you place the value at a consistent place in the label (either the beginning or the end).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would place the price at the end of the label, with a consistent amount of characters (for example, if the highest price was $50.00, I would write something that was $5.00 as $ 5.00 - with a space or 0 between the dollar sign and the number). &amp;nbsp;What you can then do is get the choice's label using the jr:choice-name() function; that can go in a subset() function to extract the last characters (for example, 5 - 50.00 is 5 characters) of the label; finally, use an number() function to change that from text to a number. &amp;nbsp;The final formula looks like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;number(substr(jr:choice-name(${item_drop_down}, '${item_drop_down}'), -5))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That can then be used in calculations. &amp;nbsp;I've attached a sample order form displaying this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 26 Nov 2019 18:58:40 GMT</pubDate>
    <dc:creator>JamesTedrick</dc:creator>
    <dc:date>2019-11-26T18:58:40Z</dc:date>
    <item>
      <title>Calculation based on select-one results</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/calculation-based-on-select-one-results/m-p/877378#M29625</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would like to use Survey123 to track activity at a recycling center. I have set up a form with a few groups to separate the type of recycling (Electronics, Metals, Bulky Items, and Construction Debris). Each of the groups contain a repeat section to add multiple items. I would like to auto calculate the total fee based on the items selected and am having a rough go at it. I want to avoid using the pull-data function from a csv file to look up the disposal fee. At first I used the fee amount as the name but that created problems because multiple items have the same fee and thus the same name so my select-one question would have multiple items selected because the names were the same (it did not throw an error). So I guess my real question is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to use a select-one field result &lt;STRONG&gt;(Item Drop Down)&amp;nbsp;&lt;/STRONG&gt;to match a second choices list and then pull the label from that second list and report it back to the Survey &lt;STRONG&gt;(Invoice Amount)&lt;/STRONG&gt;? I would like to note that multiple class of items can be disposed of at a time so the Invoice Amount would need to look into every repeat and all table entries of that repeat for the specific survey instance.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/474549_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can I create my own custom column in the choices tab of the excel sheet and somehow just reference a custom column to do calculations?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My alternative is to have the workers manually enter a price for each item and then run a calculation to populate Invoice Amount, I did not want to create too many field in the survey.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Nov 2019 22:24:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/calculation-based-on-select-one-results/m-p/877378#M29625</guid>
      <dc:creator>BillKrukowski</dc:creator>
      <dc:date>2019-11-25T22:24:13Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation based on select-one results</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/calculation-based-on-select-one-results/m-p/877379#M29626</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Bill,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In general, I think it would be more efficient/sustainable to do this with a pulldata() function using a csv lookup. &amp;nbsp;That being said, you may be able to do this if you place the value at a consistent place in the label (either the beginning or the end).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would place the price at the end of the label, with a consistent amount of characters (for example, if the highest price was $50.00, I would write something that was $5.00 as $ 5.00 - with a space or 0 between the dollar sign and the number). &amp;nbsp;What you can then do is get the choice's label using the jr:choice-name() function; that can go in a subset() function to extract the last characters (for example, 5 - 50.00 is 5 characters) of the label; finally, use an number() function to change that from text to a number. &amp;nbsp;The final formula looks like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;number(substr(jr:choice-name(${item_drop_down}, '${item_drop_down}'), -5))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That can then be used in calculations. &amp;nbsp;I've attached a sample order form displaying this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Nov 2019 18:58:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/calculation-based-on-select-one-results/m-p/877379#M29626</guid>
      <dc:creator>JamesTedrick</dc:creator>
      <dc:date>2019-11-26T18:58:40Z</dc:date>
    </item>
  </channel>
</rss>

