<?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: Help in Calculating Difference when a multiple selection is involved in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/help-in-calculating-difference-when-a-multiple/m-p/1135050#M39832</link>
    <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/16421"&gt;@DougBrowning&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I set all binds to int, and I fixed that calculation but still...same as before&lt;BR /&gt;&lt;BR /&gt;I uploaded here the updated XLS, in case you have time to see it again.&lt;BR /&gt;Thank you for the hint. I have always overlooked that bind.&lt;/P&gt;</description>
    <pubDate>Wed, 19 Jan 2022 17:15:06 GMT</pubDate>
    <dc:creator>PanGIS</dc:creator>
    <dc:date>2022-01-19T17:15:06Z</dc:date>
    <item>
      <title>Help in Calculating Difference when a multiple selection is involved</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/help-in-calculating-difference-when-a-multiple/m-p/1134598#M39811</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I've created a calculation that counts how many problems are solved.&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;- Problems are first selected from a multiple selection question. Every problem, if selected is =1 in a hidden question. the sum of all of them gives me the "Problem = number"&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;When the problem is selected a question: "it has been solved" comes up: if answered &lt;STRONG&gt;yes&lt;/STRONG&gt;, an hidden question collects =1 and they are summed up. Solved = number&lt;/LI&gt;&lt;LI&gt;A calculation Problems - Solved = to be fixed&lt;/LI&gt;&lt;LI&gt;this I know how many problems I have, how many fixed or not&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;It works perfectly if all my 3 problems are selected, if I select only one or two the calculation doesn't work: solved and to be fixed are empty.&lt;/P&gt;&lt;P&gt;this is a repeat table. By default all values are set to 0 {es.=&amp;nbsp;if(selected(${Problem},'Choice_1'),1,0)}, can't understand why the value Solved and To be fixed is empty&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PanGIS_2-1642521257176.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/31703iEB1B9BC5F1241251/image-size/medium?v=v2&amp;amp;px=400" role="button" title="PanGIS_2-1642521257176.png" alt="PanGIS_2-1642521257176.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PanGIS_1-1642521219994.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/31702i3466643A2DD66B14/image-size/medium?v=v2&amp;amp;px=400" role="button" title="PanGIS_1-1642521219994.png" alt="PanGIS_1-1642521219994.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PanGIS_0-1642521177799.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/31701i0ADE836F2822D167/image-size/medium?v=v2&amp;amp;px=400" role="button" title="PanGIS_0-1642521177799.png" alt="PanGIS_0-1642521177799.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jan 2022 16:03:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/help-in-calculating-difference-when-a-multiple/m-p/1134598#M39811</guid>
      <dc:creator>PanGIS</dc:creator>
      <dc:date>2022-01-18T16:03:13Z</dc:date>
    </item>
    <item>
      <title>Re: Help in Calculating Difference when a multiple selection is involved</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/help-in-calculating-difference-when-a-multiple/m-p/1134622#M39814</link>
      <description>&lt;P&gt;One way to fix that is to add two calculated fields (hidden) after each choices, one if the option is yes and one if no . for each answer set corresponding field to 1, then add a sum for each value solved yes or no. then you can use the sum fields for the label.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jan 2022 16:34:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/help-in-calculating-difference-when-a-multiple/m-p/1134622#M39814</guid>
      <dc:creator>nabaz-gharib</dc:creator>
      <dc:date>2022-01-18T16:34:58Z</dc:date>
    </item>
    <item>
      <title>Re: Help in Calculating Difference when a multiple selection is involved</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/help-in-calculating-difference-when-a-multiple/m-p/1134650#M39815</link>
      <description>&lt;P&gt;My guess is you have&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;{es.=&amp;nbsp;if(selected(${Problem},'Choice_1'),1,0)}, outside the repeat.&amp;nbsp; Would help to see the form.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jan 2022 17:01:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/help-in-calculating-difference-when-a-multiple/m-p/1134650#M39815</guid>
      <dc:creator>DougBrowning</dc:creator>
      <dc:date>2022-01-18T17:01:26Z</dc:date>
    </item>
    <item>
      <title>Re: Help in Calculating Difference when a multiple selection is involved</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/help-in-calculating-difference-when-a-multiple/m-p/1134908#M39825</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/16421"&gt;@DougBrowning&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;all the calculations are inside the repeat.&lt;/P&gt;&lt;P&gt;This is my sample.&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jan 2022 14:35:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/help-in-calculating-difference-when-a-multiple/m-p/1134908#M39825</guid>
      <dc:creator>PanGIS</dc:creator>
      <dc:date>2022-01-19T14:35:18Z</dc:date>
    </item>
    <item>
      <title>Re: Help in Calculating Difference when a multiple selection is involved</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/help-in-calculating-difference-when-a-multiple/m-p/1134974#M39829</link>
      <description>&lt;P&gt;I did not get a chance to test but I bet it is the bind.&lt;/P&gt;&lt;P&gt;For your 3 hidden counts like Choice1_T set the&amp;nbsp;bind::type to int.&amp;nbsp; That way it is treated as a int in the form.&amp;nbsp; I know you have the esri bind there but that really just sets the service field and does not set the type while in the form.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also see you use int later on most of them but you missed...&lt;/P&gt;&lt;P&gt;count_Problems&amp;nbsp; &amp;nbsp;try setting that field bind type to int also.&lt;/P&gt;&lt;P&gt;So right here&amp;nbsp;${count_Problems} - int(${count_Problems_Solved})&amp;nbsp; count _problems is still a string.&lt;/P&gt;&lt;P&gt;I think that should do it.&lt;/P&gt;&lt;P&gt;It is easier to just set the bind column vs using int all the time.&amp;nbsp; Hope that does it.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jan 2022 15:30:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/help-in-calculating-difference-when-a-multiple/m-p/1134974#M39829</guid>
      <dc:creator>DougBrowning</dc:creator>
      <dc:date>2022-01-19T15:30:21Z</dc:date>
    </item>
    <item>
      <title>Re: Help in Calculating Difference when a multiple selection is involved</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/help-in-calculating-difference-when-a-multiple/m-p/1135050#M39832</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/16421"&gt;@DougBrowning&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I set all binds to int, and I fixed that calculation but still...same as before&lt;BR /&gt;&lt;BR /&gt;I uploaded here the updated XLS, in case you have time to see it again.&lt;BR /&gt;Thank you for the hint. I have always overlooked that bind.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jan 2022 17:15:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/help-in-calculating-difference-when-a-multiple/m-p/1135050#M39832</guid>
      <dc:creator>PanGIS</dc:creator>
      <dc:date>2022-01-19T17:15:06Z</dc:date>
    </item>
    <item>
      <title>Re: Help in Calculating Difference when a multiple selection is involved</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/help-in-calculating-difference-when-a-multiple/m-p/1135076#M39835</link>
      <description>&lt;P&gt;Ah it was a simple mix up.&amp;nbsp; In count_problems_Solved you were adding up the Yes No questions and not the numbers field.&amp;nbsp; You were trying to add the strings.&lt;/P&gt;&lt;P&gt;You have&amp;nbsp;int(${Choice1}) +int(${Choice2}) +int(${Choice3})&lt;/P&gt;&lt;P&gt;when you want&lt;/P&gt;&lt;P&gt;int(${Choice1_T}) +int(${Choice2_T}) +int(${Choice3_T})&lt;/P&gt;&lt;P&gt;Note you can take those int() out of there now since you set the bind field.&lt;/P&gt;&lt;P&gt;Also I would set the Choice1_T and the count solved fields to calculate vs hidden so they update better.&lt;/P&gt;&lt;P&gt;Works for me now I think you just got tripped up.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jan 2022 21:28:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/help-in-calculating-difference-when-a-multiple/m-p/1135076#M39835</guid>
      <dc:creator>DougBrowning</dc:creator>
      <dc:date>2022-01-19T21:28:02Z</dc:date>
    </item>
    <item>
      <title>Re: Help in Calculating Difference when a multiple selection is involved</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/help-in-calculating-difference-when-a-multiple/m-p/1135535#M39875</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/16421"&gt;@DougBrowning&lt;/a&gt;&amp;nbsp;thank you again!&lt;/P&gt;&lt;P&gt;I had a look at your suggestion but the problem is that I want to actually calculate :&amp;nbsp;&lt;SPAN&gt;&lt;STRONG&gt;int(${Choice1}) +int(${Choice2}) +int(${Choice3})&lt;/STRONG&gt; because these values count how many &lt;STRONG&gt;solved problems&lt;/STRONG&gt;&amp;nbsp;I have, instead&amp;nbsp;&lt;STRONG&gt;int(${Choice1_T}) +int(${Choice2_T}) +int(${Choice3_T})&lt;/STRONG&gt; calulates the &lt;STRONG&gt;original problems.&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Then, the difference gives me the number of problemes that still need to be solved, don't know if it make sense.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;${Choice1} &lt;/STRONG&gt;is a Yes or No question where no=0 and yes=1 and, I can't understand why, it sums up the values only when all 3 of them are selected&lt;STRONG&gt; (the default value is 0 and I believe here is the problem: this default&amp;nbsp;value is not taken in consideration.)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If I choose all of the in the first question, then I have all of them are answered I have 0 +1 + 0 =1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If&amp;nbsp; I choose only one or two,&amp;nbsp; this doesn't work.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jan 2022 17:41:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/help-in-calculating-difference-when-a-multiple/m-p/1135535#M39875</guid>
      <dc:creator>PanGIS</dc:creator>
      <dc:date>2022-01-20T17:41:47Z</dc:date>
    </item>
    <item>
      <title>Re: Help in Calculating Difference when a multiple selection is involved</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/help-in-calculating-difference-when-a-multiple/m-p/1135541#M39876</link>
      <description>&lt;P&gt;That makes more sense but it still wont work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is because all select one must be string.&amp;nbsp; So even though you give it a 0 and 1 it is really "0" and "1".&amp;nbsp; 123 tries to help you when all three are filled out and gifts you the conversion.&amp;nbsp; This will prob not work at all on the web.&lt;/P&gt;&lt;P&gt;Best thing is to make a second set of if(value, 1, 0) and then count those just like you do for Choice_T.&amp;nbsp; I think it is the best way.&amp;nbsp; int("") is what is causing the non calc.&lt;/P&gt;&lt;P&gt;Other option that may work is to use&amp;nbsp;&lt;SPAN&gt;coalesce("", 0) and put that inside the int.&amp;nbsp; Then it should give you 0 if it is sitting on blank.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Hope that helps&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jan 2022 17:50:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/help-in-calculating-difference-when-a-multiple/m-p/1135541#M39876</guid>
      <dc:creator>DougBrowning</dc:creator>
      <dc:date>2022-01-20T17:50:31Z</dc:date>
    </item>
    <item>
      <title>Re: Help in Calculating Difference when a multiple selection is involved</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/help-in-calculating-difference-when-a-multiple/m-p/1136339#M39917</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/16421"&gt;@DougBrowning&lt;/a&gt;&amp;nbsp;wrote:&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best thing is to make a second set of if(value, 1, 0) and then count those just like you do for Choice_T.&amp;nbsp; I think it is the best way.&amp;nbsp; int("") is what is causing the non calc.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Thank you!!! this&amp;nbsp; solution worked, and it is amazing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately, I realized that when I set the esri:parameter to &lt;STRONG&gt;allowUpdates=true&lt;/STRONG&gt; the count goes back to NULL as it was before.&lt;/P&gt;&lt;P&gt;This is a pity because I need to review a previous survey and for some reason it doesn't pick up all the info, but I am still working on it. I have to see if there is a workaround.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jan 2022 13:08:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/help-in-calculating-difference-when-a-multiple/m-p/1136339#M39917</guid>
      <dc:creator>PanGIS</dc:creator>
      <dc:date>2022-01-24T13:08:46Z</dc:date>
    </item>
    <item>
      <title>Re: Help in Calculating Difference when a multiple selection is involved</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/help-in-calculating-difference-when-a-multiple/m-p/1136382#M39920</link>
      <description>&lt;P&gt;I think I saw that in there.&amp;nbsp; It should be this I think.&lt;/P&gt;&lt;P&gt;query allowUpdates=true&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jan 2022 14:49:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/help-in-calculating-difference-when-a-multiple/m-p/1136382#M39920</guid>
      <dc:creator>DougBrowning</dc:creator>
      <dc:date>2022-01-24T14:49:19Z</dc:date>
    </item>
  </channel>
</rss>

