<?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 of the purchases of 1st tickets of the customers in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Sum-of-the-purchases-of-1st-tickets-of-the-customers/m-p/1006885#M961498</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And now tested in your qvw, for all customers, can you try?:&lt;/P&gt;&lt;P&gt;Sum(Aggr(If([Ticket ID]=Min(TOTAL &amp;lt;[Consumer ID]&amp;gt; [Ticket ID]), Sum(Amount)), [Consumer ID], [Ticket ID]))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 19 Oct 2015 15:38:44 GMT</pubDate>
    <dc:creator>rubenmarin</dc:creator>
    <dc:date>2015-10-19T15:38:44Z</dc:date>
    <item>
      <title>Sum of the purchases of 1st tickets of the customers</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-of-the-purchases-of-1st-tickets-of-the-customers/m-p/1006883#M961496</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 Need to calculate : Sum of the purchases of 1st tickets of the customers, sorted out by 1st week of purchase&lt;BR /&gt;I write the dimension with no problem at all : =week(aggr(min([Date ticket]),[Code conso]))&lt;/P&gt;&lt;P&gt;for the indicator I make the test : &lt;BR /&gt;=sum({&amp;lt;[Date ticket]={"=aggr(min([Date ticket]),[Code conso])"}&amp;gt;}[CA])&lt;/P&gt;&lt;P&gt;But for certain customers the result is false .&lt;/P&gt;&lt;P&gt;the Data is&lt;BR /&gt; &lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="482"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="17" width="81"&gt;Consumer&lt;BR /&gt;&amp;nbsp; ID&lt;/TD&gt;&lt;TD class="xl63" style="border-left-color: currentColor; border-left-width: medium; border-left-style: none;" width="67"&gt;Ticket Date&lt;/TD&gt;&lt;TD class="xl63" style="border-left-color: currentColor; border-left-width: medium; border-left-style: none;" width="86"&gt;ligne ticket ID&lt;/TD&gt;&lt;TD class="xl63" style="border-left-color: currentColor; border-left-width: medium; border-left-style: none;" width="55"&gt;Ticket ID&lt;/TD&gt;&lt;TD class="xl63" style="border-left-color: currentColor; border-left-width: medium; border-left-style: none;" width="89"&gt;PRODUCT&lt;/TD&gt;&lt;TD class="xl63" style="border-left-color: currentColor; border-left-width: medium; border-left-style: none;" width="52"&gt;Amount&lt;/TD&gt;&lt;TD class="xl63" style="border-left-color: currentColor; border-left-width: medium; border-left-style: none;" width="52"&gt;Quantity&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl64" height="17" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;357789&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;06/12/2014&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;281151170&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;87488143&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;93081_01_19/22&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;11&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl64" height="17" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;357789&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;06/12/2014&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;281151171&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;87488143&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;18021_01_12M&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;45&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl64" height="17" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;357789&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;06/12/2014&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;281151172&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;87488143&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;30121_01_12M&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;69&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl64" height="17" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;357789&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;06/12/2014&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;281151173&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;87488143&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;90141_01_46&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;25&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl64" height="17" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;357789&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;30/05/2015&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;298252889&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;92124169&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;25002_45_2A&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;25,2&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl64" height="17" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;357789&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;30/05/2015&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;298252890&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;92124169&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;10022_77_2A&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;21&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;BR /&gt;I want the sum of amount of the 1rst ticket (06/12/2014) of the consumer 357789 : 150&lt;/P&gt;&lt;P&gt;Any other idea?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I put in attached files an example of application and the expected result(profit)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Oct 2015 09:57:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-of-the-purchases-of-1st-tickets-of-the-customers/m-p/1006883#M961496</guid>
      <dc:creator />
      <dc:date>2015-10-19T09:57:18Z</dc:date>
    </item>
    <item>
      <title>Re: Sum of the purchases of 1st tickets of the customers</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-of-the-purchases-of-1st-tickets-of-the-customers/m-p/1006884#M961497</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Magali, can you try?;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For one customer: FirstSortedValue(Sum(Amount), [Ticket ID])&lt;/P&gt;&lt;P&gt;For all customers: Sum(Aggr(FirstSortedValue(Sum(Amount), [Ticket ID]), [Consumer ID]))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Oct 2015 15:33:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-of-the-purchases-of-1st-tickets-of-the-customers/m-p/1006884#M961497</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2015-10-19T15:33:29Z</dc:date>
    </item>
    <item>
      <title>Re: Sum of the purchases of 1st tickets of the customers</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-of-the-purchases-of-1st-tickets-of-the-customers/m-p/1006885#M961498</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And now tested in your qvw, for all customers, can you try?:&lt;/P&gt;&lt;P&gt;Sum(Aggr(If([Ticket ID]=Min(TOTAL &amp;lt;[Consumer ID]&amp;gt; [Ticket ID]), Sum(Amount)), [Consumer ID], [Ticket ID]))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Oct 2015 15:38:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-of-the-purchases-of-1st-tickets-of-the-customers/m-p/1006885#M961498</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2015-10-19T15:38:44Z</dc:date>
    </item>
    <item>
      <title>Re: Sum of the purchases of 1st tickets of the customers</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-of-the-purchases-of-1st-tickets-of-the-customers/m-p/1006886#M961499</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;thanks a lot for your help Ruben.&lt;/P&gt;&lt;P&gt;My answers :&lt;/P&gt;&lt;P&gt;For one customer: FirstSortedValue(Sum(Amount), [Ticket ID]) =&amp;gt; error in expression&lt;/P&gt;&lt;P&gt;For all customers: Sum(Aggr(FirstSortedValue(Sum(Amount), [Ticket ID]), [Consumer ID]))&amp;nbsp; =&amp;gt; 0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and the third is OK !&lt;/P&gt;&lt;P&gt;Sum(Aggr(If([Ticket ID]=Min(TOTAL &amp;lt;[Consumer ID]&amp;gt; [Ticket ID]), Sum(Amount)), [Consumer ID], [Ticket ID]))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I understood your expression. I do not know well the Aggregation functions&amp;nbsp; but thanks to you I progressed a lot today. Thank you very much&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Oct 2015 16:42:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-of-the-purchases-of-1st-tickets-of-the-customers/m-p/1006886#M961499</guid>
      <dc:creator />
      <dc:date>2015-10-19T16:42:53Z</dc:date>
    </item>
  </channel>
</rss>

