<?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: How to write code to get 90 days data with max of each date dynamically in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-write-code-to-get-90-days-data-with-max-of-each-date/m-p/2021113#M1222064</link>
    <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/48934"&gt;@abc_18&lt;/a&gt;&amp;nbsp; can you share a sample data and the expected output ?&lt;/P&gt;</description>
    <pubDate>Mon, 02 Jan 2023 19:48:04 GMT</pubDate>
    <dc:creator>Taoufiq_Zarra</dc:creator>
    <dc:date>2023-01-02T19:48:04Z</dc:date>
    <item>
      <title>How to write code to get 90 days data with max of each date dynamically</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-write-code-to-get-90-days-data-with-max-of-each-date/m-p/2021105#M1222063</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;I have a date column in the table that also contains timestamp values, and that table's jobs run four times each day at the ETL end. As a result, the historical table has many partitions, which might potentially increase the size of the qvd.&lt;/P&gt;
&lt;P&gt;Need help with writing code at the extract layer to retrieve data for 90 days with a maximum of each date is needed (max value from out of 4 partition in a day ).&lt;/P&gt;
&lt;P&gt;Please suggest.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jan 2023 16:50:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-write-code-to-get-90-days-data-with-max-of-each-date/m-p/2021105#M1222063</guid>
      <dc:creator>abc_18</dc:creator>
      <dc:date>2023-01-02T16:50:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to write code to get 90 days data with max of each date dynamically</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-write-code-to-get-90-days-data-with-max-of-each-date/m-p/2021113#M1222064</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/48934"&gt;@abc_18&lt;/a&gt;&amp;nbsp; can you share a sample data and the expected output ?&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jan 2023 19:48:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-write-code-to-get-90-days-data-with-max-of-each-date/m-p/2021113#M1222064</guid>
      <dc:creator>Taoufiq_Zarra</dc:creator>
      <dc:date>2023-01-02T19:48:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to write code to get 90 days data with max of each date dynamically</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-write-code-to-get-90-days-data-with-max-of-each-date/m-p/2021206#M1222068</link>
      <description>&lt;P&gt;Hello, Taoufiq&lt;/P&gt;
&lt;P&gt;Here is a sample table; you can see that the "&lt;STRONG&gt;orderdate&lt;/STRONG&gt;" column contains date values with various timestamps for the same day. Data provided in the table go back more than a year.&lt;/P&gt;
&lt;P&gt;Now my requirement is to get data just for 90 days with a maximum of each date, need help in writing code at the extract layer.&lt;/P&gt;
&lt;P&gt;For instance, the maximum value for the four partitions as of December 28, 2022, will be&lt;/P&gt;
&lt;P&gt;2022-12-28T11:45:03.501+0000&lt;/P&gt;
&lt;TABLE width="874"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="64"&gt;id&lt;/TD&gt;
&lt;TD width="140"&gt;pollingstatus&lt;/TD&gt;
&lt;TD width="198"&gt;POdate&lt;/TD&gt;
&lt;TD width="161"&gt;thresholdvalue&lt;/TD&gt;
&lt;TD width="113"&gt;status&lt;/TD&gt;
&lt;TD width="198"&gt;orderdate&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;325375&lt;/TD&gt;
&lt;TD&gt;null&lt;/TD&gt;
&lt;TD&gt;2012-09-04T19:10:00.000+0000&lt;/TD&gt;
&lt;TD&gt;No&lt;/TD&gt;
&lt;TD&gt;Disabled&lt;/TD&gt;
&lt;TD&gt;2022-12-28T11:45:03.501+0000&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;231567&lt;/TD&gt;
&lt;TD&gt;null&lt;/TD&gt;
&lt;TD&gt;2014-08-19T18:25:00.000+0000&lt;/TD&gt;
&lt;TD&gt;No&lt;/TD&gt;
&lt;TD&gt;Disabled&lt;/TD&gt;
&lt;TD&gt;2022-12-28T11:35:03.501+0000&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;567890&lt;/TD&gt;
&lt;TD&gt;null&lt;/TD&gt;
&lt;TD&gt;2013-02-17T10:35:00.000+0000&lt;/TD&gt;
&lt;TD&gt;No&lt;/TD&gt;
&lt;TD&gt;Enabled&lt;/TD&gt;
&lt;TD&gt;2022-12-28T11:25:03.501+0000&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;325375&lt;/TD&gt;
&lt;TD&gt;null&lt;/TD&gt;
&lt;TD&gt;null&lt;/TD&gt;
&lt;TD&gt;No&lt;/TD&gt;
&lt;TD&gt;Enabled&lt;/TD&gt;
&lt;TD&gt;2022-12-28T11:20:03.501+0000&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;234567&lt;/TD&gt;
&lt;TD&gt;null&lt;/TD&gt;
&lt;TD&gt;null&lt;/TD&gt;
&lt;TD&gt;No&lt;/TD&gt;
&lt;TD&gt;Enabled&lt;/TD&gt;
&lt;TD&gt;2022-12-27T11:45:03.501+0000&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;325372&lt;/TD&gt;
&lt;TD&gt;null&lt;/TD&gt;
&lt;TD&gt;null&lt;/TD&gt;
&lt;TD&gt;No&lt;/TD&gt;
&lt;TD&gt;Enabled&lt;/TD&gt;
&lt;TD&gt;2022-12-27T11:40:03.501+0000&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;325370&lt;/TD&gt;
&lt;TD&gt;null&lt;/TD&gt;
&lt;TD&gt;null&lt;/TD&gt;
&lt;TD&gt;No&lt;/TD&gt;
&lt;TD&gt;Enabled&lt;/TD&gt;
&lt;TD&gt;2022-12-27T11:35:03.501+0000&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
      <pubDate>Tue, 03 Jan 2023 08:43:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-write-code-to-get-90-days-data-with-max-of-each-date/m-p/2021206#M1222068</guid>
      <dc:creator>abc_18</dc:creator>
      <dc:date>2023-01-03T08:43:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to write code to get 90 days data with max of each date dynamically</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-write-code-to-get-90-days-data-with-max-of-each-date/m-p/2021492#M1222081</link>
      <description>&lt;P&gt;You could use a resident table with two/three columns: Date (date value from orderdate),&amp;nbsp;&lt;SPAN&gt;orderdate, id (id field if you require to map the latest id key).&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;In the script you would do something like this&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;Maxtms:
Load
    Date(Date#(Left(orderdate,10),'YYYY-MM-DD')) 	as Date,
    Max(orderdate) 			as orderdate_recent_tms,
	Max(id)				as id_recent
resident [original table name]
Group by Date(Date#(Left(orderdate,10),'YYYY-MM-DD'));&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;... this will, deliberately, give you the latest TMS (timestamp) of each date, and its id value... now if you need the latest 90 days, you can apply where statement after resident and before group by&lt;/P&gt;
&lt;P&gt;ex:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;Where Date(Date#(Left(orderdate,10),'YYYY-MM-DD')) &amp;gt;= Today()-90

&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps you with your challenge or gives you hints to have it resolved!&lt;/P&gt;
&lt;P&gt;Cheers!&lt;/P&gt;
&lt;P&gt;Luis G&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jan 2023 23:13:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-write-code-to-get-90-days-data-with-max-of-each-date/m-p/2021492#M1222081</guid>
      <dc:creator>Luis_Galvan</dc:creator>
      <dc:date>2023-01-03T23:13:52Z</dc:date>
    </item>
  </channel>
</rss>

