<?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: Get last date for each ID in Connectivity &amp; Data Prep</title>
    <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Get-last-date-for-each-ID/m-p/1877844#M10064</link>
    <description>&lt;P&gt;load id,min(date) resident table group by id;&lt;/P&gt;
&lt;P&gt;you will get min date for each id&lt;/P&gt;
&lt;P&gt;then u can do the calculation on top..&lt;/P&gt;</description>
    <pubDate>Thu, 06 Jan 2022 08:25:06 GMT</pubDate>
    <dc:creator>anat</dc:creator>
    <dc:date>2022-01-06T08:25:06Z</dc:date>
    <item>
      <title>Get last date for each ID</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Get-last-date-for-each-ID/m-p/1877829#M10062</link>
      <description>&lt;P&gt;Say I have the following:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;#[transactions]

id  date
--+-----
1   2021-01-01
1   2021-01-05
2   2021-01-01
2   2021-02-03&lt;/LI-CODE&gt;
&lt;P&gt;and I want to get the day since last purchase. If I create a measure like this&lt;/P&gt;
&lt;P&gt;Now()-date&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I get it for all transactions but I just want it for the last transaction for each ID.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I could do something like&amp;nbsp;&amp;nbsp;&amp;nbsp; "MIN(Now()-date)"&amp;nbsp; but I don't know how to calculate it within a "group" i.e within each "id"&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jan 2022 07:55:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Get-last-date-for-each-ID/m-p/1877829#M10062</guid>
      <dc:creator>jakobjensen</dc:creator>
      <dc:date>2022-01-06T07:55:53Z</dc:date>
    </item>
    <item>
      <title>Re: Get last date for each ID</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Get-last-date-for-each-ID/m-p/1877844#M10064</link>
      <description>&lt;P&gt;load id,min(date) resident table group by id;&lt;/P&gt;
&lt;P&gt;you will get min date for each id&lt;/P&gt;
&lt;P&gt;then u can do the calculation on top..&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jan 2022 08:25:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Get-last-date-for-each-ID/m-p/1877844#M10064</guid>
      <dc:creator>anat</dc:creator>
      <dc:date>2022-01-06T08:25:06Z</dc:date>
    </item>
    <item>
      <title>Re: Get last date for each ID</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Get-last-date-for-each-ID/m-p/1877845#M10065</link>
      <description>&lt;P&gt;Hi, you can use an expression like:&lt;/P&gt;
&lt;P&gt;if(date=Max(TOTAL &amp;lt;id&amp;gt; date),date-Max(TOTAL &amp;lt;id&amp;gt; date, 2))&lt;/P&gt;
&lt;P&gt;or "if(date=Max({1} TOTAL &amp;lt;id&amp;gt; date),date-Max({1} TOTAL &amp;lt;id&amp;gt; date, 2))" to ignore date selections&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jan 2022 08:26:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Get-last-date-for-each-ID/m-p/1877845#M10065</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2022-01-06T08:26:35Z</dc:date>
    </item>
  </channel>
</rss>

