<?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: Calculating a value from one or more choices in a list in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/calculating-a-value-from-one-or-more-choices-in-a/m-p/825883#M17022</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This can be done by using the selected() function to check if a response is selected paired with an if() function to assign a value when selected. &amp;nbsp;Assuming A=1,B=1,C=2,D=2:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(selected(${q}, 'A'), 1, 0) +&amp;nbsp;&lt;SPAN&gt;if(selected(${q}, 'B'), 1, 0)&amp;nbsp;+&amp;nbsp;&lt;SPAN&gt;if(selected(${q}, 'C'), 2, 0)&amp;nbsp;+&amp;nbsp;&lt;SPAN&gt;if(selected(${q}, 'D'), 2, 0)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;If all choices are associated with the same value, you could use [value]*count-selected(). &amp;nbsp;For example, if all choices match to a value of 1,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;count-selected(${q})&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;is the correct function.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 02 May 2019 20:57:58 GMT</pubDate>
    <dc:creator>JamesTedrick</dc:creator>
    <dc:date>2019-05-02T20:57:58Z</dc:date>
    <item>
      <title>Calculating a value from one or more choices in a list</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/calculating-a-value-from-one-or-more-choices-in-a/m-p/825882#M17021</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am interested in assigning numeric values to items selected from a list in the choices tab, then using to calculate a result.&amp;nbsp; I assume this is possible, but am not having any luck with he syntax I'm using.&amp;nbsp; Here's my example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Question:&amp;nbsp; Please select one of the items below&lt;/P&gt;&lt;P&gt;(from list name "items")&amp;nbsp;&lt;/P&gt;&lt;P&gt;A&lt;/P&gt;&lt;P&gt;B&lt;/P&gt;&lt;P&gt;C&lt;/P&gt;&lt;P&gt;D&lt;/P&gt;&lt;P&gt;user selects one or more values in list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a separate type field called "score" in which I want to assign values to items in the list if they are checked, then calculate a value&amp;nbsp;(let's say I select A and B), assign a value to the selected (A=1, B=1), and add all the values.&amp;nbsp; if A and B are selected, result would be 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know there has to be a simple answer...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dave&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 May 2019 20:50:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/calculating-a-value-from-one-or-more-choices-in-a/m-p/825882#M17021</guid>
      <dc:creator>DavidGilbey</dc:creator>
      <dc:date>2019-05-02T20:50:31Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating a value from one or more choices in a list</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/calculating-a-value-from-one-or-more-choices-in-a/m-p/825883#M17022</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This can be done by using the selected() function to check if a response is selected paired with an if() function to assign a value when selected. &amp;nbsp;Assuming A=1,B=1,C=2,D=2:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(selected(${q}, 'A'), 1, 0) +&amp;nbsp;&lt;SPAN&gt;if(selected(${q}, 'B'), 1, 0)&amp;nbsp;+&amp;nbsp;&lt;SPAN&gt;if(selected(${q}, 'C'), 2, 0)&amp;nbsp;+&amp;nbsp;&lt;SPAN&gt;if(selected(${q}, 'D'), 2, 0)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;If all choices are associated with the same value, you could use [value]*count-selected(). &amp;nbsp;For example, if all choices match to a value of 1,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;count-selected(${q})&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;is the correct function.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 May 2019 20:57:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/calculating-a-value-from-one-or-more-choices-in-a/m-p/825883#M17022</guid>
      <dc:creator>JamesTedrick</dc:creator>
      <dc:date>2019-05-02T20:57:58Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating a value from one or more choices in a list</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/calculating-a-value-from-one-or-more-choices-in-a/m-p/825884#M17023</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That did it.&amp;nbsp; Thanks.&amp;nbsp; I was using the list name and not the question name in my calculation.&amp;nbsp; Appreciate it James!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/DG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 May 2019 21:16:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/calculating-a-value-from-one-or-more-choices-in-a/m-p/825884#M17023</guid>
      <dc:creator>DavidGilbey</dc:creator>
      <dc:date>2019-05-02T21:16:58Z</dc:date>
    </item>
  </channel>
</rss>

