<?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: Count duplicates and calculate with them in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Count-duplicates-and-calculate-with-them/m-p/1116481#M19192</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This works just fine. Many thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Jun 2016 07:27:34 GMT</pubDate>
    <dc:creator>hendriks_steffe</dc:creator>
    <dc:date>2016-06-16T07:27:34Z</dc:date>
    <item>
      <title>Count duplicates and calculate with them</title>
      <link>https://community.qlik.com/t5/App-Development/Count-duplicates-and-calculate-with-them/m-p/1116473#M19184</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a table which consists of the following data, for example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid #000000; width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Item No&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Attribute A&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Attribute B&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Counted duplicates&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1234&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;w&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;a&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;0,25&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1234&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;x&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;b&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;0,25&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1234&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;y&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;c&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;0,25&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1234&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;z&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;d&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;0,25&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2345&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;f&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;e&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;3456&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;g&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;t&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;0,33&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;3456&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;h&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;n&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;0,33&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;3456&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;i&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;m&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;0,33&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to create that last column. To do that I need something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1 / (how many times does an Item No exist in the table)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My approaches until now are:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1/count([Item No])&lt;/P&gt;&lt;P&gt;1/count(if([Item No]=[Item No], [Item No]))&lt;/P&gt;&lt;P&gt;1/(count(distinct [Item No])/count([Item No]))&lt;/P&gt;&lt;P&gt;(count(distinct [Item No])/count([Item No]))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But none of them produces the results I need.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 07:30:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Count-duplicates-and-calculate-with-them/m-p/1116473#M19184</guid>
      <dc:creator>hendriks_steffe</dc:creator>
      <dc:date>2016-06-15T07:30:56Z</dc:date>
    </item>
    <item>
      <title>Re: Count duplicates and calculate with them</title>
      <link>https://community.qlik.com/t5/App-Development/Count-duplicates-and-calculate-with-them/m-p/1116474#M19185</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is the attached qvw what you need ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Filip&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 09:14:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Count-duplicates-and-calculate-with-them/m-p/1116474#M19185</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-06-15T09:14:45Z</dc:date>
    </item>
    <item>
      <title>Re: Count duplicates and calculate with them</title>
      <link>https://community.qlik.com/t5/App-Development/Count-duplicates-and-calculate-with-them/m-p/1116475#M19186</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; line-height: 1.5em;"&gt;&lt;STRONG style="text-decoration: line-through;"&gt;1/Count(TOTAL [Item No])&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; line-height: 1.5em;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; line-height: 1.5em;"&gt;&lt;STRONG&gt;&lt;STRONG style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;1/Count(TOTAL&amp;lt;[Item No]&amp;gt; &lt;STRONG style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;[Item No]&lt;/STRONG&gt;)&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 10:28:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Count-duplicates-and-calculate-with-them/m-p/1116475#M19186</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-06-15T10:28:25Z</dc:date>
    </item>
    <item>
      <title>Re: Count duplicates and calculate with them</title>
      <link>https://community.qlik.com/t5/App-Development/Count-duplicates-and-calculate-with-them/m-p/1116476#M19187</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That would help. How did you create the last column in the loading script?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 10:53:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Count-duplicates-and-calculate-with-them/m-p/1116476#M19187</guid>
      <dc:creator>hendriks_steffe</dc:creator>
      <dc:date>2016-06-15T10:53:16Z</dc:date>
    </item>
    <item>
      <title>Re: Count duplicates and calculate with them</title>
      <link>https://community.qlik.com/t5/App-Development/Count-duplicates-and-calculate-with-them/m-p/1116477#M19188</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;that does the same thing as &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;1/count([Item No])&lt;/SPAN&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 11:06:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Count-duplicates-and-calculate-with-them/m-p/1116477#M19188</guid>
      <dc:creator>hendriks_steffe</dc:creator>
      <dc:date>2016-06-15T11:06:53Z</dc:date>
    </item>
    <item>
      <title>Re: Count duplicates and calculate with them</title>
      <link>https://community.qlik.com/t5/App-Development/Count-duplicates-and-calculate-with-them/m-p/1116478#M19189</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Isn't this what you wanted?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/127982_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 13:29:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Count-duplicates-and-calculate-with-them/m-p/1116478#M19189</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-06-15T13:29:32Z</dc:date>
    </item>
    <item>
      <title>Re: Count duplicates and calculate with them</title>
      <link>https://community.qlik.com/t5/App-Development/Count-duplicates-and-calculate-with-them/m-p/1116479#M19190</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sunny T,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry but it seems I haven't made myself &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;fully clear.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your solution works just fine in a created Table as an element in Qlik Sense.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I need this column in my original data, therefore I need a solution for the loading script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I try your approach in my loading script like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;,&lt;/STRONG&gt;&lt;STRONG style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit;"&gt;1/Count(TOTAL&amp;lt;[Item No]&amp;gt; [Item No])&lt;/STRONG&gt;&lt;/STRONG&gt; as [Item_Counter];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get the following error message:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;Error in expression: ')' expected&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 13:47:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Count-duplicates-and-calculate-with-them/m-p/1116479#M19190</guid>
      <dc:creator>hendriks_steffe</dc:creator>
      <dc:date>2016-06-15T13:47:09Z</dc:date>
    </item>
    <item>
      <title>Re: Count duplicates and calculate with them</title>
      <link>https://community.qlik.com/t5/App-Development/Count-duplicates-and-calculate-with-them/m-p/1116480#M19191</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For script based solution, try this out:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Table:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD [Item No], &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Attribute A], &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Attribute B]&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FROM&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;A class="jive-link-thread-small" data-containerid="2156" data-containertype="14" data-objectid="220880" data-objecttype="1" href="https://community.qlik.com/thread/220880"&gt;https://community.qlik.com/thread/220880&lt;/A&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;(html, codepage is 1252, embedded labels, table is @1);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Left Join(Table)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD [Item No],&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; Count([Item No]) as Total&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Resident Table&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Group By [Item No];&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FinalTable:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD *,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; 1/Total as NewColumn&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Resident Table;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;DROP Table Table;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 15:17:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Count-duplicates-and-calculate-with-them/m-p/1116480#M19191</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-06-15T15:17:09Z</dc:date>
    </item>
    <item>
      <title>Re: Count duplicates and calculate with them</title>
      <link>https://community.qlik.com/t5/App-Development/Count-duplicates-and-calculate-with-them/m-p/1116481#M19192</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This works just fine. Many thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 07:27:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Count-duplicates-and-calculate-with-them/m-p/1116481#M19192</guid>
      <dc:creator>hendriks_steffe</dc:creator>
      <dc:date>2016-06-16T07:27:34Z</dc:date>
    </item>
  </channel>
</rss>

