<?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: Count IDs last occurrence by time range in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Count-IDs-last-occurrence-by-time-range/m-p/1809725#M65981</link>
    <description>&lt;P&gt;You can incorporate the E() element function in your set analysis for KPIs 2 and 3 to exclude IDs with activity in specific time frame, like this (based on your desciription, I wasn't sure if you are counting today when determining time frames or not, so you may need to adjust the numbers to meet your needs):&lt;/P&gt;&lt;P&gt;KPI 1:&lt;/P&gt;&lt;P&gt;count({$&amp;lt;Date={"&amp;lt;=$(=Today())&amp;gt;=$(=Date(Today()-3))"}&amp;gt;} Distinct [ID])&lt;/P&gt;&lt;P&gt;KPI 2:&lt;/P&gt;&lt;P&gt;count({$&amp;lt;Date={"&amp;lt;$(=Date(Today()-3))&amp;gt;=$(=Date(Today()-21))"},&lt;BR /&gt;[ID]=E({&amp;lt;Date={"&amp;lt;=$(=Today())&amp;gt;=$(=Date(Today()-3))"}&amp;gt;} [ID])&amp;gt;} Distinct [ID])&lt;/P&gt;&lt;P&gt;KPI 3:&lt;/P&gt;&lt;P&gt;count({$&amp;lt;Date={"&amp;lt;$(=Date(Today()-26))"},&lt;BR /&gt;[ID]=E({&amp;lt;Date={"&amp;lt;=$(=Today())&amp;gt;=$(=Date(Today()-26))"}&amp;gt;} [ID])&amp;gt;} Distinct [ID])&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 21 May 2021 11:42:57 GMT</pubDate>
    <dc:creator>GaryGiles</dc:creator>
    <dc:date>2021-05-21T11:42:57Z</dc:date>
    <item>
      <title>Count IDs last occurrence by time range</title>
      <link>https://community.qlik.com/t5/App-Development/Count-IDs-last-occurrence-by-time-range/m-p/1809714#M65980</link>
      <description>&lt;P&gt;Hi! I want to show the latest activity of an user in KPIs between different time ranges.&lt;/P&gt;&lt;P&gt;Example dataset:&lt;/P&gt;&lt;P&gt;We have an ID and a Date for each line:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="KristofHasko_6-1621594441345.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/55459i517E0740F58A10AA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="KristofHasko_6-1621594441345.png" alt="KristofHasko_6-1621594441345.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Lets say that the current date is 2021.05.30.&lt;/P&gt;&lt;P&gt;KPI1: Count if the user had activity in the last 3 days:&amp;nbsp;&lt;/P&gt;&lt;P&gt;Result should be 1 because only user 3 had activity in the last 3 days (between 05.30 and 05.27).&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="KristofHasko_7-1621594529877.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/55460i1449FA1177320E40/image-size/medium?v=v2&amp;amp;px=400" role="button" title="KristofHasko_7-1621594529877.png" alt="KristofHasko_7-1621594529877.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;KPI2: Count if the user had no activity in the last 3 days, but had activity between the last 3 days, and last 20 days(between 05.27 and 05.10):&lt;/P&gt;&lt;P&gt;Result should be 1 because user 2 and 3 had activity, but user 3 is already counted in the first KPI:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="KristofHasko_9-1621594717870.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/55463iEDD886F7858886D0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="KristofHasko_9-1621594717870.png" alt="KristofHasko_9-1621594717870.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;KPI3:&amp;nbsp;Count if the user had no activity in the last 25 days but had activity before that (before 05.05):&amp;nbsp;&lt;/P&gt;&lt;P&gt;Should be 1, because only user 1 had activity before the given range&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="KristofHasko_10-1621594831154.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/55464iD7692C76392645FF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="KristofHasko_10-1621594831154.png" alt="KristofHasko_10-1621594831154.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have already tried everything, but nothing worked, I'm out of ideas.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 May 2021 11:02:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Count-IDs-last-occurrence-by-time-range/m-p/1809714#M65980</guid>
      <dc:creator>KristofHasko</dc:creator>
      <dc:date>2021-05-21T11:02:38Z</dc:date>
    </item>
    <item>
      <title>Re: Count IDs last occurrence by time range</title>
      <link>https://community.qlik.com/t5/App-Development/Count-IDs-last-occurrence-by-time-range/m-p/1809725#M65981</link>
      <description>&lt;P&gt;You can incorporate the E() element function in your set analysis for KPIs 2 and 3 to exclude IDs with activity in specific time frame, like this (based on your desciription, I wasn't sure if you are counting today when determining time frames or not, so you may need to adjust the numbers to meet your needs):&lt;/P&gt;&lt;P&gt;KPI 1:&lt;/P&gt;&lt;P&gt;count({$&amp;lt;Date={"&amp;lt;=$(=Today())&amp;gt;=$(=Date(Today()-3))"}&amp;gt;} Distinct [ID])&lt;/P&gt;&lt;P&gt;KPI 2:&lt;/P&gt;&lt;P&gt;count({$&amp;lt;Date={"&amp;lt;$(=Date(Today()-3))&amp;gt;=$(=Date(Today()-21))"},&lt;BR /&gt;[ID]=E({&amp;lt;Date={"&amp;lt;=$(=Today())&amp;gt;=$(=Date(Today()-3))"}&amp;gt;} [ID])&amp;gt;} Distinct [ID])&lt;/P&gt;&lt;P&gt;KPI 3:&lt;/P&gt;&lt;P&gt;count({$&amp;lt;Date={"&amp;lt;$(=Date(Today()-26))"},&lt;BR /&gt;[ID]=E({&amp;lt;Date={"&amp;lt;=$(=Today())&amp;gt;=$(=Date(Today()-26))"}&amp;gt;} [ID])&amp;gt;} Distinct [ID])&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 May 2021 11:42:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Count-IDs-last-occurrence-by-time-range/m-p/1809725#M65981</guid>
      <dc:creator>GaryGiles</dc:creator>
      <dc:date>2021-05-21T11:42:57Z</dc:date>
    </item>
    <item>
      <title>Re: Count IDs last occurrence by time range</title>
      <link>https://community.qlik.com/t5/App-Development/Count-IDs-last-occurrence-by-time-range/m-p/1809729#M65982</link>
      <description>&lt;P&gt;Element function... It is mind blowing how many different functions Qlik has. I'll try it as soon as possible.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Edit: The solution works! Thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 21 May 2021 12:09:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Count-IDs-last-occurrence-by-time-range/m-p/1809729#M65982</guid>
      <dc:creator>KristofHasko</dc:creator>
      <dc:date>2021-05-21T12:09:45Z</dc:date>
    </item>
  </channel>
</rss>

