<?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: sum distinct values with a script in load editor in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/sum-distinct-values-with-a-script-in-load-editor/m-p/2093433#M89621</link>
    <description>&lt;P&gt;Hello, Thanks for the answer however it does not help me, perhaps I have missed one important info:&lt;/P&gt;
&lt;P&gt;Imagine the values can be just 0 or 1. for the same sequnce Id I can get many rows and each can have value 0 or 1. I need to have a boolean OR over those values , so that maximum 1 can appear. the sum shall be done over all the sequences therefore the maximum expected number will be the number of the sequences.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With the proposed solution above in contrast I receive different summed values for the sequences.&lt;/P&gt;
&lt;P&gt;Can you please help to "limit" and have max. 1 for each sequence? Thanks!&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MarZu_1-1689239312119.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/112171i585CDF71099C89D3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MarZu_1-1689239312119.png" alt="MarZu_1-1689239312119.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 13 Jul 2023 09:15:10 GMT</pubDate>
    <dc:creator>MarZu</dc:creator>
    <dc:date>2023-07-13T09:15:10Z</dc:date>
    <item>
      <title>sum distinct values with a script in load editor</title>
      <link>https://community.qlik.com/t5/App-Development/sum-distinct-values-with-a-script-in-load-editor/m-p/2093329#M89599</link>
      <description>&lt;DIV style="box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Web', sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;
&lt;DIV&gt;Hello, I want to sum the entries of the field "value" only for distinct values of another one "Sequence Id".&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;See below a pseudo example: the "calculate" table shall reuse previously loaded fields from the table "tag".&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;It sounds easy in visualisation but I have to do it in the load editor and apparently the same syntax is not available (aggr?). Please note that the it is not a matter to delete the rows which appears double.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Anyone has an Idea? How would be instead with an if ...then structure?&lt;/DIV&gt;
&lt;DIV&gt;Thanks!!!&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;EM&gt;&lt;SPAN&gt;[calculate]:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Load &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Sum(Aggr([Value]),distinct [Sequence Id])) as Counter&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;resident&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;tag;&lt;/SPAN&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 13 Jul 2023 06:10:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/sum-distinct-values-with-a-script-in-load-editor/m-p/2093329#M89599</guid>
      <dc:creator>MarZu</dc:creator>
      <dc:date>2023-07-13T06:10:52Z</dc:date>
    </item>
    <item>
      <title>Re: sum distinct values with a script in load editor</title>
      <link>https://community.qlik.com/t5/App-Development/sum-distinct-values-with-a-script-in-load-editor/m-p/2093366#M89603</link>
      <description>&lt;P&gt;Please see if this helps&lt;BR /&gt;&lt;BR /&gt;Load&lt;BR /&gt;&amp;nbsp; &amp;nbsp;[Sequence Id],&lt;BR /&gt;&amp;nbsp; &amp;nbsp;Sum([Value]) as Counter&lt;BR /&gt;Resident&lt;BR /&gt;&amp;nbsp; &amp;nbsp;tag&lt;BR /&gt;Group By&lt;BR /&gt;&amp;nbsp; &amp;nbsp;[Sequence Id];&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jul 2023 07:46:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/sum-distinct-values-with-a-script-in-load-editor/m-p/2093366#M89603</guid>
      <dc:creator>Chirantha</dc:creator>
      <dc:date>2023-07-13T07:46:28Z</dc:date>
    </item>
    <item>
      <title>Re: sum distinct values with a script in load editor</title>
      <link>https://community.qlik.com/t5/App-Development/sum-distinct-values-with-a-script-in-load-editor/m-p/2093384#M89608</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Load&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Distinct&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;[Sequence Id],&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;Sum([Value]) as Counter&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Resident&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;tag&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Group By&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;[Sequence Id];&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jul 2023 08:22:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/sum-distinct-values-with-a-script-in-load-editor/m-p/2093384#M89608</guid>
      <dc:creator>udit_k</dc:creator>
      <dc:date>2023-07-13T08:22:00Z</dc:date>
    </item>
    <item>
      <title>Re: sum distinct values with a script in load editor</title>
      <link>https://community.qlik.com/t5/App-Development/sum-distinct-values-with-a-script-in-load-editor/m-p/2093433#M89621</link>
      <description>&lt;P&gt;Hello, Thanks for the answer however it does not help me, perhaps I have missed one important info:&lt;/P&gt;
&lt;P&gt;Imagine the values can be just 0 or 1. for the same sequnce Id I can get many rows and each can have value 0 or 1. I need to have a boolean OR over those values , so that maximum 1 can appear. the sum shall be done over all the sequences therefore the maximum expected number will be the number of the sequences.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With the proposed solution above in contrast I receive different summed values for the sequences.&lt;/P&gt;
&lt;P&gt;Can you please help to "limit" and have max. 1 for each sequence? Thanks!&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MarZu_1-1689239312119.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/112171i585CDF71099C89D3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MarZu_1-1689239312119.png" alt="MarZu_1-1689239312119.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jul 2023 09:15:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/sum-distinct-values-with-a-script-in-load-editor/m-p/2093433#M89621</guid>
      <dc:creator>MarZu</dc:creator>
      <dc:date>2023-07-13T09:15:10Z</dc:date>
    </item>
    <item>
      <title>Re: sum distinct values with a script in load editor</title>
      <link>https://community.qlik.com/t5/App-Development/sum-distinct-values-with-a-script-in-load-editor/m-p/2093781#M89646</link>
      <description>&lt;P&gt;Hi Thank you, but it seems to produces the same result as the first solution despite DISTINCT I get counted all the values for the same single sequence.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Perhaps it helps my observation: Imagine the values can be just 0 or 1. for the same sequence Id I can get many rows and each can have value 0 or 1. I need to have a boolean OR over those values , so that maximum 1 can appear. the sum shall be done over all the sequences therefore the maximum expected number will be the number of the sequences.&amp;nbsp; --&amp;gt; is there a way to do that? Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jul 2023 07:05:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/sum-distinct-values-with-a-script-in-load-editor/m-p/2093781#M89646</guid>
      <dc:creator>MarZu</dc:creator>
      <dc:date>2023-07-14T07:05:19Z</dc:date>
    </item>
    <item>
      <title>Re: sum distinct values with a script in load editor</title>
      <link>https://community.qlik.com/t5/App-Development/sum-distinct-values-with-a-script-in-load-editor/m-p/2094974#M89714</link>
      <description>&lt;P&gt;Indeed I found the solution by using an intermediate step and it works as I wanted and I share it here:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV id="bodyDisplay_2" class="lia-message-body lia-component-message-view-widget-body lia-component-body-signature-highlight-escalation lia-component-message-view-widget-body-signature-highlight-escalation"&gt;
&lt;DIV class="lia-message-body-content"&gt;
&lt;P&gt;&lt;SPAN&gt;Temp:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Load&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Distinct&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;[Sequence Id],&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;'dummy' as Dummy,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; Max([Value]) as MaxCounter&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Resident&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;tag&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Group By&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;[Sequence Id];&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV id="bodyDisplay_2" class="lia-message-body lia-component-message-view-widget-body lia-component-body-signature-highlight-escalation lia-component-message-view-widget-body-signature-highlight-escalation"&gt;
&lt;DIV class="lia-message-body-content"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Load&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Distinct&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;[Sequence Id],&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Dummy,&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;Sum([MaxCounter]) as Counter&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Resident&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; Temp&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Group By&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;[Dummy];&lt;/SPAN&gt;&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Tue, 18 Jul 2023 15:33:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/sum-distinct-values-with-a-script-in-load-editor/m-p/2094974#M89714</guid>
      <dc:creator>MarZu</dc:creator>
      <dc:date>2023-07-18T15:33:53Z</dc:date>
    </item>
  </channel>
</rss>

