<?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: Year on Year Repeat Count of Customer in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Year-on-Year-Repeat-Count-of-Customer/m-p/2532876#M108153</link>
    <description>&lt;P&gt;I think I would use interrecord-functions to create appropriate counter/offset/flag-information within the data-model. This means simplified something like:&lt;/P&gt;&lt;P&gt;load *, if(CustomerID = previous(CustomerID), peek('Nr') + 1, 1) as Nr&lt;BR /&gt;resident X order by CustomerID, Date desc;&lt;/P&gt;&lt;P&gt;which creates a running counter per customer. But with such an approach you could also calculate the date-offset between the current record and the previous one and/or against today() and/or against the daynumberofyear(). On top may come a clustering of the offsets in months/years and some if-checks on them.&lt;/P&gt;</description>
    <pubDate>Wed, 08 Oct 2025 13:26:45 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2025-10-08T13:26:45Z</dc:date>
    <item>
      <title>Year on Year Repeat Count of Customer</title>
      <link>https://community.qlik.com/t5/App-Development/Year-on-Year-Repeat-Count-of-Customer/m-p/2532116#M108077</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I am working on a logic where we have to show the repeat and new customer. If the customer was repetitively coming in current year or previous years then that customer is Repeat Customer. If the customer came only once in the year and there is no precedence of the customer then it is new customer. And I have to show the repeat customer in 4 ways. Current Year Repeat (Customer came in current year and is repititive), Previous Year Repeat (Customer Came in previous year and current year. whether it be once or more than once in each year), Previous to Previous Year Repeat (Customer Came in 2 years bach and in current year. whether it be once or more than once in each year) and PtoP to current Year Repeat(Customer Came in all 3 years. Like Previous years and current year. whether it be once or more than once in each year). Attached a sample excel file for reference.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Tue, 30 Sep 2025 11:09:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Year-on-Year-Repeat-Count-of-Customer/m-p/2532116#M108077</guid>
      <dc:creator>qliksenseadminthomascook</dc:creator>
      <dc:date>2025-09-30T11:09:46Z</dc:date>
    </item>
    <item>
      <title>Re: Year on Year Repeat Count of Customer</title>
      <link>https://community.qlik.com/t5/App-Development/Year-on-Year-Repeat-Count-of-Customer/m-p/2532194#M108090</link>
      <description>&lt;P&gt;Hi, this would be easy if you want a current state chart, where you can precalculte this on script:&lt;/P&gt;&lt;P&gt;1. create auxiliary tables to identify customers in previous years, like:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;chkPtoP:
LOAD Distinct Customer as chkPtoP
Resident DataTable 
Where Year=Year(Today())-2;

chkP:
LOAD Distinct Customer as chkP
Resident DataTable 
Where Year=Year(Today())-1;&lt;/LI-CODE&gt;&lt;P&gt;2. Load customers to do the checks:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;tmpCustomerType:
LOAD 
  Customer,
  If(Exists('chkPtoP',Customer),1,0) as isPtoP,
  If(Exists('chkP',Customer),1,0) as isP,
  Count(Customer) as NumCY
Resident DataTable 
Where Year=Year(Today())
Group By Customer
;

DROP Table chkPtoP;
DROP Table chkP;&lt;/LI-CODE&gt;&lt;P&gt;3.Calculate conditions&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;CustomerType:
Noconcatenate LOAD
  Customer,
  If(isPtoP
    ,If(isP
      ,'PtoP to CY RPT'
      ,'PtoP RPT')
    ,If(isP
      ,'PY RPT'
      ,If(NumCY&amp;gt;1
        ,'CY RPT'
        ,'CY New'
))) as CustomerType
Resident tmpCustomerType;

DROP Table tmpCustomerType;&lt;/LI-CODE&gt;&lt;P&gt;Not tested, maybe there is a typo, but I think you can get the idea from this.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Oct 2025 08:19:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Year-on-Year-Repeat-Count-of-Customer/m-p/2532194#M108090</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2025-10-01T08:19:10Z</dc:date>
    </item>
    <item>
      <title>Re: Year on Year Repeat Count of Customer</title>
      <link>https://community.qlik.com/t5/App-Development/Year-on-Year-Repeat-Count-of-Customer/m-p/2532867#M108152</link>
      <description>&lt;P&gt;Hi Rebenmarin,&lt;/P&gt;&lt;P&gt;Thank you for your inputs. However I need to show the data based on the selections and this will give me the data only it is static. Can you please help me for the selections as well. Like if the end user selects the year, branch or any other filter given, it should give the data accordingly which I believe we can do it with expressions and set analysis only.&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Oct 2025 12:19:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Year-on-Year-Repeat-Count-of-Customer/m-p/2532867#M108152</guid>
      <dc:creator>qliksenseadminthomascook</dc:creator>
      <dc:date>2025-10-08T12:19:55Z</dc:date>
    </item>
    <item>
      <title>Re: Year on Year Repeat Count of Customer</title>
      <link>https://community.qlik.com/t5/App-Development/Year-on-Year-Repeat-Count-of-Customer/m-p/2532876#M108153</link>
      <description>&lt;P&gt;I think I would use interrecord-functions to create appropriate counter/offset/flag-information within the data-model. This means simplified something like:&lt;/P&gt;&lt;P&gt;load *, if(CustomerID = previous(CustomerID), peek('Nr') + 1, 1) as Nr&lt;BR /&gt;resident X order by CustomerID, Date desc;&lt;/P&gt;&lt;P&gt;which creates a running counter per customer. But with such an approach you could also calculate the date-offset between the current record and the previous one and/or against today() and/or against the daynumberofyear(). On top may come a clustering of the offsets in months/years and some if-checks on them.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Oct 2025 13:26:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Year-on-Year-Repeat-Count-of-Customer/m-p/2532876#M108153</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2025-10-08T13:26:45Z</dc:date>
    </item>
    <item>
      <title>Re: Year on Year Repeat Count of Customer</title>
      <link>https://community.qlik.com/t5/App-Development/Year-on-Year-Repeat-Count-of-Customer/m-p/2532919#M108162</link>
      <description>&lt;P&gt;Hi, in example from a data like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rubenmarin_0-1759949562074.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/184093i4FFFC52D36A630D7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="rubenmarin_0-1759949562074.png" alt="rubenmarin_0-1759949562074.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Using this expression:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;If(Max(Year)=Max(TOTAL {1&amp;lt;Year={"&amp;lt;=$(=Max(Year))"}&amp;gt;} Year) and Max({&amp;lt;Year={"&amp;lt;=$(=Max(Year))"}&amp;gt;} Year,2)=Max(TOTAL {1&amp;lt;Year={"&amp;lt;=$(=Max(Year))"}&amp;gt;} Year,2) and Max({&amp;lt;Year={"&amp;lt;=$(=Max(Year))"}&amp;gt;} Year,3)=Max(TOTAL {1&amp;lt;Year={"&amp;lt;=$(=Max(Year))"}&amp;gt;} Year,3)
  ,'PtoP to CY RPT'
  ,If(Max(Year)=Max(TOTAL {1&amp;lt;Year={"&amp;lt;=$(=Max(Year))"}&amp;gt;} Year)  and Max({&amp;lt;Year={"&amp;lt;=$(=Max(Year))"}&amp;gt;}Year,2)=Max(TOTAL {1&amp;lt;Year={"&amp;lt;=$(=Max(Year))"}&amp;gt;} Year,3)
    ,'PtoP RPT'
    ,If(Max(Year)=Max(TOTAL {1&amp;lt;Year={"&amp;lt;=$(=Max(Year))"}&amp;gt;} Year)  and Max({&amp;lt;Year={"&amp;lt;=$(=Max(Year))"}&amp;gt;}Year,2)=Max(TOTAL {1&amp;lt;Year={"&amp;lt;=$(=Max(Year))"}&amp;gt;} Year,2)
      ,'PY RPT'
      ,If(Sum(Data)&amp;gt;1
        ,'CY RPT'
        ,If(Sum(Data)=1,'CY New'
)))))&lt;/LI-CODE&gt;&lt;P&gt;It will work based on year selections, and it should work also with branch selections&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rubenmarin_2-1759950381197.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/184095i152E01891551DCF6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="rubenmarin_2-1759950381197.png" alt="rubenmarin_2-1759950381197.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;And selecting 2024:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rubenmarin_3-1759950400569.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/184096i56A0F43CD656EBAC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="rubenmarin_3-1759950400569.png" alt="rubenmarin_3-1759950400569.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Oct 2025 19:08:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Year-on-Year-Repeat-Count-of-Customer/m-p/2532919#M108162</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2025-10-08T19:08:19Z</dc:date>
    </item>
  </channel>
</rss>

