<?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 to count if a customer have come back, help with dates please in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-count-if-a-customer-have-come-back-help-with-dates-please/m-p/433309#M1151053</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I have a table with cusomer information. It´s basics are customer ID, orderID and dates for each happening in the order, I only use First_Date and Latest_Date in the case. I want to know if a customer have come back within 365 days from the latest "Latest_Date". &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If so, the First_Date of a OrderID should be within 365 days from the Latest_Date of a earlier OrderID&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please see attached file. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 03 Jun 2013 12:57:17 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-06-03T12:57:17Z</dc:date>
    <item>
      <title>How to count if a customer have come back, help with dates please</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-count-if-a-customer-have-come-back-help-with-dates-please/m-p/433309#M1151053</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I have a table with cusomer information. It´s basics are customer ID, orderID and dates for each happening in the order, I only use First_Date and Latest_Date in the case. I want to know if a customer have come back within 365 days from the latest "Latest_Date". &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If so, the First_Date of a OrderID should be within 365 days from the Latest_Date of a earlier OrderID&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please see attached file. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Jun 2013 12:57:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-count-if-a-customer-have-come-back-help-with-dates-please/m-p/433309#M1151053</guid>
      <dc:creator />
      <dc:date>2013-06-03T12:57:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to count if a customer have come back, help with dates please</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-count-if-a-customer-have-come-back-help-with-dates-please/m-p/433310#M1151054</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try sum(aggr(if(max(Första_Händelse)&amp;gt;max(Sista_Händelse) and max(Första_Händelse)-max(Sista_Händelse) &amp;lt;365 and count(PERSID)&amp;gt;1,1,0),PERSID))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Jun 2013 13:54:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-count-if-a-customer-have-come-back-help-with-dates-please/m-p/433310#M1151054</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2013-06-03T13:54:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to count if a customer have come back, help with dates please</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-count-if-a-customer-have-come-back-help-with-dates-please/m-p/433311#M1151055</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks. quit helpful but don´t solve it completly. &lt;/P&gt;&lt;P&gt;Somehow it count people that only have one order so I simply added a if-statement in the beginning. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But the part in the expression that state that the First_date - Latest_Date should be &amp;lt;&amp;lt; 365 days don´t work. Also, I found out that some people have placed a new order before the first are closed, in case the customer should not be counted for.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think I have to look at a alternative solution, maybe do a intervall match in the script or mapp the dates somehow. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;AGGR&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;COUNT&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;DISTINCT&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;AEVERKNR1&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;), &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;AKTPNR&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &amp;gt;&amp;gt; 1,&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;aggr&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;BR /&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;max&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Date&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Första_Händelse&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)) &amp;gt;&amp;gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;max&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Date&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Sista_Händelse&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;AND&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp; &lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;//&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;max(Date(Första_Händelse)) - max(Date(Sista_Händelse)) &amp;gt;&amp;gt; 0 AND &lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;max&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Date&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Första_Händelse&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)) - &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;max&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Date&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Sista_Händelse&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)) &amp;lt;&amp;lt; 365&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;count&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;AKTPNR&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &amp;gt;&amp;gt; 1, 1, 0), &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;AKTPNR&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;))) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Jun 2013 19:32:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-count-if-a-customer-have-come-back-help-with-dates-please/m-p/433311#M1151055</guid>
      <dc:creator />
      <dc:date>2013-06-03T19:32:07Z</dc:date>
    </item>
  </channel>
</rss>

