<?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 How can you use the distinct function in a script? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-can-you-use-the-distinct-function-in-a-script/m-p/74731#M788174</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have an expression which works fine in an app, however when I try to put this into a script, it doesn't work. The below is what I'm looking to achieve in the script;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum(distinct{&amp;lt;[DG.class]={'1'}&amp;gt;}[DG.uomactqty])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-11-25T16:16:04Z</dc:date>
    <item>
      <title>How can you use the distinct function in a script?</title>
      <link>https://community.qlik.com/t5/QlikView/How-can-you-use-the-distinct-function-in-a-script/m-p/74731#M788174</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have an expression which works fine in an app, however when I try to put this into a script, it doesn't work. The below is what I'm looking to achieve in the script;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum(distinct{&amp;lt;[DG.class]={'1'}&amp;gt;}[DG.uomactqty])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-can-you-use-the-distinct-function-in-a-script/m-p/74731#M788174</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: How can you use the distinct function in a script?</title>
      <link>https://community.qlik.com/t5/QlikView/How-can-you-use-the-distinct-function-in-a-script/m-p/74732#M788175</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think the issue isn't the use of &lt;EM&gt;distinct&lt;/EM&gt; but rather&amp;nbsp; that the chart function sum() and the script function sum() are not interchangeable, particularly where set analysis is concerned.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can probably accomplish your goal with something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table:&lt;/P&gt;&lt;P&gt;Load sum(distinct [DG.uomactqty]) as total&amp;nbsp; resident DG group by &amp;lt;DG.something&amp;gt; where DG.class='1';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then you can assign the &lt;EM&gt;total&lt;/EM&gt; to a variable using the peek function. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Feb 2018 18:30:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-can-you-use-the-distinct-function-in-a-script/m-p/74732#M788175</guid>
      <dc:creator>stascher</dc:creator>
      <dc:date>2018-02-22T18:30:02Z</dc:date>
    </item>
    <item>
      <title>Re: How can you use the distinct function in a script?</title>
      <link>https://community.qlik.com/t5/QlikView/How-can-you-use-the-distinct-function-in-a-script/m-p/74733#M788176</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;SPAN class="script_token" style="font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; color: #0f0f0f;"&gt;&lt;SPAN class="statement" style="color: #0f0f0f; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace;"&gt;SUM syntaxes:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;SPAN class="script_token" style="font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; color: #0f0f0f;"&gt;&lt;SPAN class="statement" style="color: #0f0f0f; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace;"&gt;SUM chart function syntax:&lt;/SPAN&gt;&lt;SPAN class="statement" style="color: #0f0f0f; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace;"&gt; &lt;SPAN class="script_token" style="font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; color: #0f0f0f;"&gt;&lt;STRONG&gt;Sum(&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN class="bnf_token" style="font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; color: #0f0f0f;"&gt;[{SetExpression}] [DISTINCT] [TOTAL [&amp;lt;fld {,fld}&amp;gt;]] expr]&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN class="statement" style="color: #0f0f0f; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace;"&gt;&lt;SPAN class="statement" style="color: #0f0f0f; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace;"&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;SPAN class="script_token" style="font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; color: #0f0f0f;"&gt;&lt;SPAN class="statement" style="color: #0f0f0f; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace;"&gt;&lt;SPAN class="statement" style="color: #0f0f0f; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace;"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;SUM script function syntax:&lt;/SPAN&gt;&lt;SPAN class="script_token" style="font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; color: #0f0f0f;"&gt; &lt;STRONG&gt;sum (&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN style="color: #0f0f0f; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; background-color: #f4f4f4;"&gt; [ &lt;/SPAN&gt;&lt;SPAN class="script_token" style="font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; color: #0f0f0f;"&gt;distinct&lt;/SPAN&gt;&lt;SPAN class="bnf_token" style="font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; color: #0f0f0f;"&gt;] expr&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN class="statement" style="color: #0f0f0f; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace;"&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN class="statement" style="color: #0f0f0f; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 12pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;The SetExpression does not works in sum script function like works in sum chart function&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Feb 2018 11:12:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-can-you-use-the-distinct-function-in-a-script/m-p/74733#M788176</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-02-23T11:12:54Z</dc:date>
    </item>
  </channel>
</rss>

