<?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 Calculate new and lost customers in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Calculate-new-and-lost-customers/m-p/161817#M35566</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;This script would eliminate to add the new column&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TempCustomers:&lt;BR /&gt;&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt; Customer, Year&lt;BR /&gt; Tom, 2009&lt;BR /&gt; Tom, 2010&lt;BR /&gt; Jim, 2010&lt;BR /&gt; Sam, 2009];&lt;BR /&gt;&lt;BR /&gt;Customers:&lt;BR /&gt;Load&lt;BR /&gt; Customer,&lt;BR /&gt; Year,&lt;BR /&gt; Prev_customer,&lt;BR /&gt; if(Prev_customer=Customer, 'Exit', 'New') AS Status;&lt;BR /&gt;LOAD&lt;BR /&gt; Customer,&lt;BR /&gt; Year,&lt;BR /&gt; Previous(Customer) AS Prev_customer&lt;BR /&gt;Resident&lt;BR /&gt; TempCustomers&lt;BR /&gt;order by Customer, Year;&lt;BR /&gt;&lt;BR /&gt;Drop table TempCustomers;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 26 Feb 2010 18:38:50 GMT</pubDate>
    <dc:creator>jagan</dc:creator>
    <dc:date>2010-02-26T18:38:50Z</dc:date>
    <item>
      <title>Calculate new and lost customers</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-new-and-lost-customers/m-p/161815#M35564</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everybody!&lt;/P&gt;&lt;P&gt;Is there an elegant way to state how many customers we have gained in a given year compared to the previour year? In the attached example Tom is a loyal customer, Jim is a new one and Sam is a lost one. If I create a table years/customer type I therefore need to get 1 new customer and 1 lost customer for 2010.&lt;/P&gt;&lt;P&gt;Any suggestion please?&lt;/P&gt;&lt;P&gt;I apologise in advance since I will be able to reply only on Monday morning, but I believe in time zones benefits!&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;Luca&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Feb 2010 18:07:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-new-and-lost-customers/m-p/161815#M35564</guid>
      <dc:creator />
      <dc:date>2010-02-26T18:07:53Z</dc:date>
    </item>
    <item>
      <title>Calculate new and lost customers</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-new-and-lost-customers/m-p/161816#M35565</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;If you add another field to the table specifying whether the customer is new or left, then we can calculate the number of new and left customers easily.&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;BR /&gt; Customer, Year, Type&lt;BR /&gt; Tom, 2009, New&lt;BR /&gt; Tom, 2010, Exit&lt;BR /&gt; Jim, 2010, New&lt;BR /&gt; Sam, 2009, New&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;Then use the expressions&lt;/P&gt;&lt;P&gt;Count({$&amp;lt;Type={'New'}&amp;gt;}Customer) //New Customers count&lt;/P&gt;&lt;P&gt;Count({$&amp;lt;Type={'Exit'}&amp;gt;}Customer) //left customers count&lt;/P&gt;&lt;P&gt;Hope this helps you&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Feb 2010 18:24:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-new-and-lost-customers/m-p/161816#M35565</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2010-02-26T18:24:22Z</dc:date>
    </item>
    <item>
      <title>Calculate new and lost customers</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-new-and-lost-customers/m-p/161817#M35566</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;This script would eliminate to add the new column&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TempCustomers:&lt;BR /&gt;&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt; Customer, Year&lt;BR /&gt; Tom, 2009&lt;BR /&gt; Tom, 2010&lt;BR /&gt; Jim, 2010&lt;BR /&gt; Sam, 2009];&lt;BR /&gt;&lt;BR /&gt;Customers:&lt;BR /&gt;Load&lt;BR /&gt; Customer,&lt;BR /&gt; Year,&lt;BR /&gt; Prev_customer,&lt;BR /&gt; if(Prev_customer=Customer, 'Exit', 'New') AS Status;&lt;BR /&gt;LOAD&lt;BR /&gt; Customer,&lt;BR /&gt; Year,&lt;BR /&gt; Previous(Customer) AS Prev_customer&lt;BR /&gt;Resident&lt;BR /&gt; TempCustomers&lt;BR /&gt;order by Customer, Year;&lt;BR /&gt;&lt;BR /&gt;Drop table TempCustomers;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Feb 2010 18:38:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-new-and-lost-customers/m-p/161817#M35566</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2010-02-26T18:38:50Z</dc:date>
    </item>
    <item>
      <title>Calculate new and lost customers</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-new-and-lost-customers/m-p/161818#M35567</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Sachin! I'll work on your suggestion. The set analysis filter is also something really helpful that I've been looking for, but I always stucked with the syntax.&lt;/P&gt;&lt;P&gt;Cheers!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Mar 2010 16:56:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-new-and-lost-customers/m-p/161818#M35567</guid>
      <dc:creator />
      <dc:date>2010-03-01T16:56:53Z</dc:date>
    </item>
  </channel>
</rss>

