<?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 i take distinct values in summary expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-can-i-take-distinct-values-in-summary-expression/m-p/765874#M272165</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a database that has&lt;/P&gt;&lt;P&gt;date , store , hour , sales&lt;/P&gt;&lt;P&gt;01/02/2015 , 101 , 19 , 10000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;some times brings a second record with another sales amount&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;date , store , hour , sales&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;01/02/2015 , 101 , 19 , 10000&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;01/02/2015 , 101 , 19 , 15000&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;how can i take only the first record in a chart with the expression sum(sales)&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;I attached a qvw file.&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Thank you in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 21 Feb 2015 08:55:43 GMT</pubDate>
    <dc:creator>geogou1973</dc:creator>
    <dc:date>2015-02-21T08:55:43Z</dc:date>
    <item>
      <title>How can i take distinct values in summary expression</title>
      <link>https://community.qlik.com/t5/QlikView/How-can-i-take-distinct-values-in-summary-expression/m-p/765874#M272165</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a database that has&lt;/P&gt;&lt;P&gt;date , store , hour , sales&lt;/P&gt;&lt;P&gt;01/02/2015 , 101 , 19 , 10000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;some times brings a second record with another sales amount&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;date , store , hour , sales&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;01/02/2015 , 101 , 19 , 10000&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;01/02/2015 , 101 , 19 , 15000&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;how can i take only the first record in a chart with the expression sum(sales)&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;I attached a qvw file.&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Thank you in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Feb 2015 08:55:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-can-i-take-distinct-values-in-summary-expression/m-p/765874#M272165</guid>
      <dc:creator>geogou1973</dc:creator>
      <dc:date>2015-02-21T08:55:43Z</dc:date>
    </item>
    <item>
      <title>Re: How can i take distinct values in summary expression</title>
      <link>https://community.qlik.com/t5/QlikView/How-can-i-take-distinct-values-in-summary-expression/m-p/765875#M272166</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;one solution could be;&amp;nbsp; &lt;/P&gt;&lt;P&gt;- add a field in the load to identify first record by date,store,hour&lt;/P&gt;&lt;P&gt;- the chart expression is sum({$ &amp;lt;id={1}&amp;gt;} sales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;load *, AutoNumber(rowno(),date&amp;amp;'-'&amp;amp;store&amp;amp;'-'&amp;amp;hour) as id &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;inline [&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;date,store,hour,sales&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;01/02/2015,101,21,10000&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;01/02/2015,102,21,15000&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;01/02/2015,103,21,20000&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;01/02/2015,101,21,30000&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;];&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Feb 2015 09:15:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-can-i-take-distinct-values-in-summary-expression/m-p/765875#M272166</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2015-02-21T09:15:37Z</dc:date>
    </item>
    <item>
      <title>Re: How can i take distinct values in summary expression</title>
      <link>https://community.qlik.com/t5/QlikView/How-can-i-take-distinct-values-in-summary-expression/m-p/765876#M272167</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Massimo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is that the database has more than 3 million records and the process takes too long to complete the reload with autonumber . Is there any other way with expression formula to take only these values ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Feb 2015 09:38:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-can-i-take-distinct-values-in-summary-expression/m-p/765876#M272167</guid>
      <dc:creator>geogou1973</dc:creator>
      <dc:date>2015-02-21T09:38:41Z</dc:date>
    </item>
    <item>
      <title>Re: How can i take distinct values in summary expression</title>
      <link>https://community.qlik.com/t5/QlikView/How-can-i-take-distinct-values-in-summary-expression/m-p/765877#M272168</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yes auto.... is slow&lt;/P&gt;&lt;P&gt;I tried in another way, this is the script, 5 millions of record, 75 sec &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// test data&lt;/P&gt;&lt;P&gt;&lt;EM&gt;a:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;load &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;rowno() as id,&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; date(makedate(2015)+floor(rand()*30)) as date,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 101 + floor(rand()*10) as store,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; floor(rand()*24) as hour,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; floor(rand()*100000) as sales&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;autogenerate 5000000;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;b:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;NoConcatenate load &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; *,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; &lt;STRONG&gt;if(store&amp;lt;&amp;gt;Peek(store) or hour&amp;lt;&amp;gt;Peek(hour) or date&amp;lt;&amp;gt;Peek(date),1,0) as flagfirst&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; //AutoNumber(rowno(),date&amp;amp;'-'&amp;amp;store&amp;amp;'-'&amp;amp;hour) as flagfirst &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Resident a&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;order by date,store,hour,id;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;DROP Table a;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Feb 2015 10:32:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-can-i-take-distinct-values-in-summary-expression/m-p/765877#M272168</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2015-02-21T10:32:26Z</dc:date>
    </item>
    <item>
      <title>Re: How can i take distinct values in summary expression</title>
      <link>https://community.qlik.com/t5/QlikView/How-can-i-take-distinct-values-in-summary-expression/m-p/765878#M272169</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't understand where this script helps to avoid the duplicate records by date - store - hour.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Feb 2015 12:35:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-can-i-take-distinct-values-in-summary-expression/m-p/765878#M272169</guid>
      <dc:creator>geogou1973</dc:creator>
      <dc:date>2015-02-21T12:35:29Z</dc:date>
    </item>
    <item>
      <title>Re: How can i take distinct values in summary expression</title>
      <link>https://community.qlik.com/t5/QlikView/How-can-i-take-distinct-values-in-summary-expression/m-p/765879#M272170</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;the script add a field, &lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;flagfirst&lt;/STRONG&gt;&lt;EM style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;, &lt;/STRONG&gt;&lt;/EM&gt;to your table to identify the distinct record by date - store - hour (1 = first record in table by date -store-hour, 0 duplicate)&lt;/P&gt;&lt;P&gt;the chart expression use set analysis sum( {$ &amp;lt;&lt;STRONG&gt;flagfirst&lt;/STRONG&gt;={1}&amp;gt;} sales) to filter the distinct record by ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SCRIPT&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;a: &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;load *, rowno() as id&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;inline [&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;date,store,hour,sales&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;01/02/2015,101,21,10000&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;01/02/2015,102,21,15000&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;01/02/2015,103,21,20000&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;01/02/2015,101,21,1&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;01/02/2015,101,21,1&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;01/02/2015,101,21,1&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;01/02/2015,102,21,1&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;01/02/2015,103,21,1&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;01/02/2015,104,21,100&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;01/02/2015,104,22,100&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;01/02/2015,104,22,1&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;02/02/2015,104,22,100&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;02/02/2015,104,22,1&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;];&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;b:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;NoConcatenate load&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; *,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; if(store&amp;lt;&amp;gt;Peek(store) or hour&amp;lt;&amp;gt;Peek(hour) or date&amp;lt;&amp;gt;Peek(date),1,0) as flagfirst&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Resident a&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;order by date,store,hour,id;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;DROP Table a;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;RESULT&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="1.jpg" class="image-1 jive-image" src="https://community.qlik.com/legacyfs/online/78757_1.jpg" style="height: 250px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Feb 2015 14:06:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-can-i-take-distinct-values-in-summary-expression/m-p/765879#M272170</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2015-02-21T14:06:05Z</dc:date>
    </item>
    <item>
      <title>Re: How can i take distinct values in summary expression</title>
      <link>https://community.qlik.com/t5/QlikView/How-can-i-take-distinct-values-in-summary-expression/m-p/765880#M272171</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;Try&lt;/P&gt;&lt;P&gt;See Here&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" data-containerid="2051" data-containertype="14" data-objectid="51547" data-objecttype="1" href="https://community.qlik.com/thread/51547"&gt;&lt;SPAN style="color: #3778c7;"&gt;distinct value.&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Neetha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Feb 2015 18:44:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-can-i-take-distinct-values-in-summary-expression/m-p/765880#M272171</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-02-21T18:44:46Z</dc:date>
    </item>
  </channel>
</rss>

