<?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 Represent only last 3 days of a date field in Integration, Extension &amp; APIs</title>
    <link>https://community.qlik.com/t5/Integration-Extension-APIs/Represent-only-last-3-days-of-a-date-field/m-p/1937201#M16861</link>
    <description>&lt;P&gt;Hello!&lt;/P&gt;
&lt;P&gt;I have a datefield that corresponds to Shipping Date and I would like to represent a graph to know how many items where shipped on the last 3 days. These last 3 days do not necessarily have to be consecutive days, as there may be days in which nothing was shipped. I would like to represent the last 3 days in which shipping occured.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to do this on the script but I am not sure how to do it.&lt;/P&gt;
&lt;P&gt;Any ideas? Thanks!&lt;/P&gt;</description>
    <pubDate>Mon, 30 May 2022 11:49:41 GMT</pubDate>
    <dc:creator>atudela</dc:creator>
    <dc:date>2022-05-30T11:49:41Z</dc:date>
    <item>
      <title>Represent only last 3 days of a date field</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Represent-only-last-3-days-of-a-date-field/m-p/1937201#M16861</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;
&lt;P&gt;I have a datefield that corresponds to Shipping Date and I would like to represent a graph to know how many items where shipped on the last 3 days. These last 3 days do not necessarily have to be consecutive days, as there may be days in which nothing was shipped. I would like to represent the last 3 days in which shipping occured.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to do this on the script but I am not sure how to do it.&lt;/P&gt;
&lt;P&gt;Any ideas? Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 30 May 2022 11:49:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Represent-only-last-3-days-of-a-date-field/m-p/1937201#M16861</guid>
      <dc:creator>atudela</dc:creator>
      <dc:date>2022-05-30T11:49:41Z</dc:date>
    </item>
    <item>
      <title>Re: Represent only last 3 days of a date field</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Represent-only-last-3-days-of-a-date-field/m-p/1937244#M16862</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/182571"&gt;@atudela&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Can you try this,&lt;/P&gt;
&lt;P&gt;1. Load your main Table,&lt;/P&gt;
&lt;P&gt;2. Find the Max date from the table like,&lt;/P&gt;
&lt;P&gt;Left Join (TableName)&lt;/P&gt;
&lt;P&gt;Load KeyField,&lt;/P&gt;
&lt;P&gt;Max(ShippingDate) as MaxDate&lt;/P&gt;
&lt;P&gt;Resident&amp;nbsp;TableName group by&amp;nbsp;KeyField;&lt;/P&gt;
&lt;P&gt;3. Create a flag ,&lt;/P&gt;
&lt;P&gt;Load *,&lt;BR /&gt;If(MaxDate-ShippingDate&amp;lt;=2,'Last3daysSales',null()) as Last3daysSalesFlag&lt;BR /&gt;Resident Test;&lt;/P&gt;
&lt;P&gt;4. Front end Expression&lt;/P&gt;
&lt;P&gt;Sum({&amp;lt;Last3daysSalesFlag={'Last3daysSales'}&amp;gt;}Value)&lt;/P&gt;
&lt;P&gt;I hope, it will help you&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 30 May 2022 12:58:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Represent-only-last-3-days-of-a-date-field/m-p/1937244#M16862</guid>
      <dc:creator>saranyadurai</dc:creator>
      <dc:date>2022-05-30T12:58:18Z</dc:date>
    </item>
    <item>
      <title>Re: Represent only last 3 days of a date field</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Represent-only-last-3-days-of-a-date-field/m-p/1937592#M16876</link>
      <description>&lt;P&gt;Thanks for your answer! I was not sure if your propasal was going to work because I was not sure if the following condition&amp;nbsp;&lt;EM&gt;If(MaxDate-ShippingDate&amp;lt;=2&amp;nbsp;&lt;/EM&gt;... was going to give me as a result the last day in which shipping occured and the two previos days to this date;&lt;/P&gt;
&lt;P&gt;eg if Max date=12-05-2022, the other two dates obtainedd would be: 11-05-2022 and 10-05-22.&lt;/P&gt;
&lt;P&gt;However, I wanted to obtain the last 3 days in which shipping occured, this is if no shipping occured on the 10-05-2022 I would like the 3 dates to be displayed to be: 12-05-2022, 11-05-2022 and 09-05-2022 (considering that shipping occured on day 9).&lt;/P&gt;
&lt;P&gt;Maybe your proposal did manage to do this but I did not understand it.&lt;/P&gt;
&lt;P&gt;In the end I decided to solve it in a different way.&lt;/P&gt;
&lt;P&gt;In my main table I created the field:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Date(max(&lt;SPAN&gt;ShippingDate&lt;/SPAN&gt;,3),'DD-MM-YYYY') as Shippingload,&lt;/P&gt;
&lt;P&gt;afterwards I did a resident load of the main table as follows:&lt;/P&gt;
&lt;P&gt;RESIDENT MainTable where&amp;nbsp;&lt;SPAN&gt;ShippingDate&amp;gt;=Shippingload&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;This works fine.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 May 2022 08:22:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Represent-only-last-3-days-of-a-date-field/m-p/1937592#M16876</guid>
      <dc:creator>atudela</dc:creator>
      <dc:date>2022-05-31T08:22:03Z</dc:date>
    </item>
  </channel>
</rss>

