<?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: Lost Customers and New Customers in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Lost-Customers-and-New-Customers/m-p/800985#M1034657</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Set analysis does not work in the script, only in expressions used in the front end. If you use the expression you posted in the front end then it won't work because you're nested sum functions without using the aggr function. There may be other things wrong too. It would help if you could post a document that demonstrates the problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 Jan 2015 08:45:05 GMT</pubDate>
    <dc:creator>Gysbert_Wassenaar</dc:creator>
    <dc:date>2015-01-16T08:45:05Z</dc:date>
    <item>
      <title>Lost Customers and New Customers</title>
      <link>https://community.qlik.com/t5/QlikView/Lost-Customers-and-New-Customers/m-p/800984#M1034655</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi People,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to calculate Total GP for lost customers based on the selected date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The definition for Lost customer is &lt;SPAN style="font-size: 13.3333330154419px;"&gt;based on the date whichever is selected, no transaction for the last 3 months, then these customers are lost customers, then we sum total GP for&lt;SPAN style="font-size: 13.3333330154419px;"&gt; these customer at the &lt;/SPAN&gt;same period last year.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example user select 2014.12&lt;/P&gt;&lt;P&gt;if no transaction from 2014.9 - 2014.12, then we sum(GP) for these customers for the period of 2013.12&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I defined 4 variables:&lt;/P&gt;&lt;P&gt;vDateTo = Date&lt;/P&gt;&lt;P&gt;vDateFrom = AddMonths(vDateTo,-3)&lt;/P&gt;&lt;P&gt;vDateLYTo = max(AddYears(Date,-1))&lt;/P&gt;&lt;P&gt;vDateLYFrom = =min(AddYears(Date,-1))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=sum(If(Date &amp;lt;= vDateLYTo and MC_Date &amp;gt;= vDateLYFrom and &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;isnull(sum({&amp;lt;Date=&amp;gt;}If(Date &amp;lt;= vDateTo and Date &amp;gt;= vDateFrom , GP)))&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;, GP))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;But the script doesn't give me any result, any thoughts?&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jan 2015 22:30:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lost-Customers-and-New-Customers/m-p/800984#M1034655</guid>
      <dc:creator />
      <dc:date>2015-01-15T22:30:15Z</dc:date>
    </item>
    <item>
      <title>Re: Lost Customers and New Customers</title>
      <link>https://community.qlik.com/t5/QlikView/Lost-Customers-and-New-Customers/m-p/800985#M1034657</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Set analysis does not work in the script, only in expressions used in the front end. If you use the expression you posted in the front end then it won't work because you're nested sum functions without using the aggr function. There may be other things wrong too. It would help if you could post a document that demonstrates the problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2015 08:45:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lost-Customers-and-New-Customers/m-p/800985#M1034657</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2015-01-16T08:45:05Z</dc:date>
    </item>
  </channel>
</rss>

