<?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: Identifying Repeat and Unique Customers in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Identifying-Repeat-and-Unique-Customers/m-p/1734063#M721732</link>
    <description>&lt;P&gt;I agree.. Always the first row we have to consider it as a new customer. But as per the business requirement, for repeat contact, we are considering the first row as well. I am looking into your solution.&lt;/P&gt;&lt;P&gt;Thank you very much for your response.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 07 Aug 2020 10:54:32 GMT</pubDate>
    <dc:creator>Nisha_Pra</dc:creator>
    <dc:date>2020-08-07T10:54:32Z</dc:date>
    <item>
      <title>Identifying Repeat and Unique Customers</title>
      <link>https://community.qlik.com/t5/QlikView/Identifying-Repeat-and-Unique-Customers/m-p/1733790#M721728</link>
      <description>&lt;P&gt;Repeat Caller Logic within 48 hours. (Repeat caller duration is based on callstartdate and prevcallsegstartdate as per the example provided)&lt;/P&gt;&lt;P&gt;Formula: Numerator - Unique Contact , Denominator - Unique + Repeat Contact&lt;/P&gt;&lt;TABLE width="754"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="98"&gt;CustomerPhone&lt;/TD&gt;&lt;TD width="64"&gt;CallID&lt;/TD&gt;&lt;TD width="152"&gt;Callstartdate&lt;/TD&gt;&lt;TD width="152"&gt;Callenddate&lt;/TD&gt;&lt;TD width="150"&gt;prevcallstartdate&lt;/TD&gt;&lt;TD width="138"&gt;repeatcalldurationSecs&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;123&lt;/TD&gt;&lt;TD&gt;Call1&lt;/TD&gt;&lt;TD&gt;2020-06-08 11:13:05.000&lt;/TD&gt;&lt;TD&gt;2020-06-08 11:28:48.000&lt;/TD&gt;&lt;TD&gt;NULL&lt;/TD&gt;&lt;TD&gt;NULL&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;123&lt;/TD&gt;&lt;TD&gt;Call2&lt;/TD&gt;&lt;TD&gt;2020-06-08 11:39:35.000&lt;/TD&gt;&lt;TD&gt;2020-06-08 11:50:23.000&lt;/TD&gt;&lt;TD&gt;2020-06-08 11:13:05.000&lt;/TD&gt;&lt;TD&gt;1590&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;123&lt;/TD&gt;&lt;TD&gt;Call3&lt;/TD&gt;&lt;TD&gt;2020-06-11 15:24:07.000&lt;/TD&gt;&lt;TD&gt;2020-06-11 15:33:56.000&lt;/TD&gt;&lt;TD&gt;2020-06-08 11:39:35.000&lt;/TD&gt;&lt;TD&gt;272672&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;126&lt;/TD&gt;&lt;TD&gt;Call12&lt;/TD&gt;&lt;TD&gt;2020-03-22 14:40:49.000&lt;/TD&gt;&lt;TD&gt;2020-03-22 15:09:42.000&lt;/TD&gt;&lt;TD&gt;NULL&lt;/TD&gt;&lt;TD&gt;NULL&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;From the above example -&lt;BR /&gt;In the case of 123 phone number (1-2 row number) - its a repeat contact.&lt;BR /&gt;This customer contacted twice within 48 hours based on the first two rows&lt;/P&gt;&lt;P&gt;Now in the numerator - it should be 0&lt;BR /&gt;in the denominator - it should be 2&lt;/P&gt;&lt;P&gt;3rd row - again the same customer contacted after 48 hours, it should treat as a new customer&lt;BR /&gt;Now numerator - 1 and denominator - 1&lt;/P&gt;&lt;P&gt;In the case of 126 customer phone number - its unique contact&lt;BR /&gt;Now numerator - 1&lt;BR /&gt;denominator - 1&lt;/P&gt;&lt;P&gt;Total KPI value - Numerator - 0+1+1&lt;BR /&gt;Denominator - 2+1+1&lt;/P&gt;&lt;P&gt;Can someone help me how to achieve this in QV scripting?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 18:15:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Identifying-Repeat-and-Unique-Customers/m-p/1733790#M721728</guid>
      <dc:creator>Nisha_Pra</dc:creator>
      <dc:date>2024-11-16T18:15:42Z</dc:date>
    </item>
    <item>
      <title>Re: Identifying Repeat and Unique Customers</title>
      <link>https://community.qlik.com/t5/QlikView/Identifying-Repeat-and-Unique-Customers/m-p/1733969#M721729</link>
      <description>&lt;P&gt;I am not sure why the first tow rows, Numerator should be 0. Actually the first row should be considered as a new Customer and return 1.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Aug 2020 03:15:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Identifying-Repeat-and-Unique-Customers/m-p/1733969#M721729</guid>
      <dc:creator>Saravanan_Desingh</dc:creator>
      <dc:date>2020-08-07T03:15:22Z</dc:date>
    </item>
    <item>
      <title>Re: Identifying Repeat and Unique Customers</title>
      <link>https://community.qlik.com/t5/QlikView/Identifying-Repeat-and-Unique-Customers/m-p/1733971#M721730</link>
      <description>&lt;P&gt;Try this.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Let v48hAsMM=48*60;

tab1:
LOAD *, If(CustomerPhone&amp;lt;&amp;gt;Peek(CustomerPhone) Or IsNull(Peek(CustomerPhone)) Or CallDiff &amp;gt; 2,RangeSum(Peek(Key),1),Peek(Key)) As Key;
LOAD *, If(CustomerPhone=Peek(CustomerPhone), Interval(StDt-Peek(StDt))) As CallDiff;
LOAD *, Timestamp(Timestamp#(Callstartdate,'YYYY-MM-DD hh:mm:ss.fff')) As StDt;
LOAD RecNo() As RowID, * INLINE [
    CustomerPhone, CallID, Callstartdate, Callenddate, prevcallstartdate, repeatcalldurationSecs
    123, Call1, 2020-06-08 11:13:05.000, 2020-06-08 11:28:48.000, NULL, NULL
    123, Call2, 2020-06-08 11:39:35.000, 2020-06-08 11:50:23.000, 2020-06-08 11:13:05.000, 1590
    123, Call3, 2020-06-11 15:24:07.000, 2020-06-11 15:33:56.000, 2020-06-08 11:39:35.000, 272672
    126, Call12, 2020-03-22 14:40:49.000, 2020-03-22 15:09:42.000, NULL, NULL
];

Left Join(tab1)
LOAD Key, Count(Key) As Denominator
Resident tab1
Group By Key&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 07 Aug 2020 03:23:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Identifying-Repeat-and-Unique-Customers/m-p/1733971#M721730</guid>
      <dc:creator>Saravanan_Desingh</dc:creator>
      <dc:date>2020-08-07T03:23:21Z</dc:date>
    </item>
    <item>
      <title>Re: Identifying Repeat and Unique Customers</title>
      <link>https://community.qlik.com/t5/QlikView/Identifying-Repeat-and-Unique-Customers/m-p/1733972#M721731</link>
      <description>&lt;P&gt;Expression:&lt;/P&gt;&lt;P&gt;=Count(DISTINCT Key)/Sum(Denominator)&lt;/P&gt;&lt;P&gt;Which is 3/6=0.5&lt;/P&gt;</description>
      <pubDate>Fri, 07 Aug 2020 03:24:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Identifying-Repeat-and-Unique-Customers/m-p/1733972#M721731</guid>
      <dc:creator>Saravanan_Desingh</dc:creator>
      <dc:date>2020-08-07T03:24:11Z</dc:date>
    </item>
    <item>
      <title>Re: Identifying Repeat and Unique Customers</title>
      <link>https://community.qlik.com/t5/QlikView/Identifying-Repeat-and-Unique-Customers/m-p/1734063#M721732</link>
      <description>&lt;P&gt;I agree.. Always the first row we have to consider it as a new customer. But as per the business requirement, for repeat contact, we are considering the first row as well. I am looking into your solution.&lt;/P&gt;&lt;P&gt;Thank you very much for your response.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Aug 2020 10:54:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Identifying-Repeat-and-Unique-Customers/m-p/1734063#M721732</guid>
      <dc:creator>Nisha_Pra</dc:creator>
      <dc:date>2020-08-07T10:54:32Z</dc:date>
    </item>
    <item>
      <title>Re: Identifying Repeat and Unique Customers</title>
      <link>https://community.qlik.com/t5/QlikView/Identifying-Repeat-and-Unique-Customers/m-p/1734104#M721733</link>
      <description>&lt;P&gt;This is what exactly I am looking for. One thing I don't understand how you are segregating the data based on 48 hours in the logic you provided.&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Nisha_Pra_0-1596804674631.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/38692i5A1ACD06C0812C91/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Nisha_Pra_0-1596804674631.png" alt="Nisha_Pra_0-1596804674631.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;In case of Customer Phone Number - 123, In the key field for the third row, how it's showing as&amp;nbsp; "2".&amp;nbsp; This is how I wanted, If any repeat customer comes after 48 hours, should treat as a new customer. But not sure how it's working in the backend without giving the threshold as 48 hours. could you please explain?&lt;/P&gt;&lt;P&gt;My expected output is 2/4. Since the business doesn't want to consider the first row in the numerator in case of a repeat customer. To achieve this can we create a flag to identify repeat vs Unique which can be considered in the KPI. Please help me with this.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Aug 2020 13:06:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Identifying-Repeat-and-Unique-Customers/m-p/1734104#M721733</guid>
      <dc:creator>Nisha_Pra</dc:creator>
      <dc:date>2020-08-07T13:06:44Z</dc:date>
    </item>
    <item>
      <title>Re: Identifying Repeat and Unique Customers</title>
      <link>https://community.qlik.com/t5/QlikView/Identifying-Repeat-and-Unique-Customers/m-p/1737214#M721734</link>
      <description>&lt;P&gt;I am going to provide a Design Blog link that should help explain the preceding load statements, but I cannot follow-up on the 48 hour piece,&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/894"&gt;@Saravanan_Desingh&lt;/a&gt;&amp;nbsp; will have to answer that part, will see if my flag will allow him to circle back on this one.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/t5/Qlik-Design-Blog/Preceding-Load/ba-p/1469534" target="_blank"&gt;https://community.qlik.com/t5/Qlik-Design-Blog/Preceding-Load/ba-p/1469534&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Brett&lt;/P&gt;</description>
      <pubDate>Wed, 19 Aug 2020 21:34:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Identifying-Repeat-and-Unique-Customers/m-p/1737214#M721734</guid>
      <dc:creator>Brett_Bleess</dc:creator>
      <dc:date>2020-08-19T21:34:52Z</dc:date>
    </item>
    <item>
      <title>Re: Identifying Repeat and Unique Customers</title>
      <link>https://community.qlik.com/t5/QlikView/Identifying-Repeat-and-Unique-Customers/m-p/1737227#M721735</link>
      <description>&lt;P&gt;Let's say there is row 5 for 126.. which is contacted within 48 hrs..so Numerator will be 0 for row no 4?&lt;/P&gt;</description>
      <pubDate>Wed, 19 Aug 2020 22:21:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Identifying-Repeat-and-Unique-Customers/m-p/1737227#M721735</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2020-08-19T22:21:55Z</dc:date>
    </item>
    <item>
      <title>Re: Identifying Repeat and Unique Customers</title>
      <link>https://community.qlik.com/t5/QlikView/Identifying-Repeat-and-Unique-Customers/m-p/1740941#M721736</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/336"&gt;@Kushal_Chawda&lt;/a&gt;&amp;nbsp;, Yes correct. so numerator will be 0 for row no 4 since it will become repeat customer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Sep 2020 10:30:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Identifying-Repeat-and-Unique-Customers/m-p/1740941#M721736</guid>
      <dc:creator>Nisha_Pra</dc:creator>
      <dc:date>2020-09-03T10:30:55Z</dc:date>
    </item>
    <item>
      <title>Re: Identifying Repeat and Unique Customers</title>
      <link>https://community.qlik.com/t5/QlikView/Identifying-Repeat-and-Unique-Customers/m-p/1741381#M721737</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/84836"&gt;@Nisha_Pra&lt;/a&gt;&amp;nbsp; try below&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;let v48_Hrs_check = '48:00:00';

data:
LOAD RecNo() As RowID, * INLINE [
    CustomerPhone, CallID, Callstartdate, Callenddate, prevcallstartdate, repeatcalldurationSecs
    123, Call1, 2020-06-08 11:13:05.000, 2020-06-08 11:28:48.000, NULL, NULL
    123, Call2, 2020-06-08 11:39:35.000, 2020-06-08 11:50:23.000, 2020-06-08 11:13:05.000, 1590
    123, Call3, 2020-06-11 15:24:07.000, 2020-06-11 15:33:56.000, 2020-06-08 11:39:35.000, 272672
    126, Call12, 2020-03-22 14:40:49.000, 2020-03-22 15:09:42.000, NULL, NULL
];

Left Join(data)
LOAD CustomerPhone,
     Count(CustomerPhone) as CustomerPhone_Cnt
Resident data
Group by CustomerPhone;

T1:
NoConcatenate
LOAD *,
     alt(if(CustomerPhone=Peek(CustomerPhone),if(interval(Callstartdate-Peek(Callstartdate),'hh:mm:ss')&amp;lt;='$(v48_Hrs_check)',1,null()),null()),1) as Denominator,
    if((CustomerPhone=Peek(CustomerPhone) and interval(Callstartdate-Peek(Callstartdate),'hh:mm:ss')&amp;gt;'$(v48_Hrs_check)') or
    CustomerPhone_Cnt=1,1,0) as Numerator
Resident data
Order by CustomerPhone,Callstartdate;

DROP Table data;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I feel like your denominator will always have 1 value for individual row as in either of the case for repeat or not repeat customer you are counting the rows&lt;/P&gt;&lt;P&gt;So probably you could use below in load script (check it out as not sure)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;1 as Denominator&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Now you can simply use &lt;STRONG&gt;sum(Numerator)/sum(Denominator)&amp;nbsp;&lt;/STRONG&gt; as KPI&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Annotation 2020-09-05 001015.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/40113i844AECF9875AE5F2/image-size/large?v=v2&amp;amp;px=999" role="button" title="Annotation 2020-09-05 001015.png" alt="Annotation 2020-09-05 001015.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Sep 2020 23:11:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Identifying-Repeat-and-Unique-Customers/m-p/1741381#M721737</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2020-09-04T23:11:50Z</dc:date>
    </item>
  </channel>
</rss>

