<?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: Filtering data based on current date and same period (before &amp;amp; after) in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Filtering-data-based-on-current-date-and-same-period-before-amp/m-p/1759807#M719039</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/128999"&gt;@Amelia_96&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Try like below&lt;/P&gt;&lt;P&gt;Let vStartDate = MakeDate(2020, 11,1);&lt;/P&gt;&lt;P&gt;Let vAfterDate = Interval(Today() - vStartDate, 'D');&lt;/P&gt;&lt;P&gt;Let vBeforeDate = vStartDate - vAfterDate;&lt;/P&gt;&lt;P&gt;LOAD Distinct&lt;BR /&gt;Date,&lt;BR /&gt;If(Date &amp;lt; Date('$(vStartDate)','YYYY-MM-DD'), 'Before', 'After') as Period&lt;BR /&gt;FROM&lt;BR /&gt;YourSource&lt;/P&gt;&lt;P&gt;&amp;nbsp;where Date &amp;gt;= Date($(vBeforeDate),'YYYY-MM-DD');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 09 Nov 2020 11:15:47 GMT</pubDate>
    <dc:creator>MayilVahanan</dc:creator>
    <dc:date>2020-11-09T11:15:47Z</dc:date>
    <item>
      <title>Filtering data based on current date and same period (before &amp; after)</title>
      <link>https://community.qlik.com/t5/QlikView/Filtering-data-based-on-current-date-and-same-period-before-amp/m-p/1759781#M719038</link>
      <description>&lt;P&gt;Hi, currently i'm doing dashboard that need to be updated everyday (morning).&lt;/P&gt;&lt;P&gt;My start date is 01/11/2020. But i need to have comparison between 'Before' &amp;amp; 'After'. So starting from 01/11/2020 up to current date (today=09/11/2020) will be 'After' (equivalent to 9days), and the same period for 'Before' (equivalent to 9days) will be from 23/10/2020 up to 31/10/2020.&lt;/P&gt;&lt;P&gt;Below are the sample expected output for each day when data is updated:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Amelia_96_0-1604916136221.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/43806i74A3B151ACD63246/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Amelia_96_0-1604916136221.png" alt="Amelia_96_0-1604916136221.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Does anyone knows how do i write this in QlikView script to get this output when data is updated everyday?&lt;/P&gt;&lt;P&gt;Please help. Thank you in advance!&lt;/P&gt;</description>
      <pubDate>Fri, 20 Nov 2020 18:58:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Filtering-data-based-on-current-date-and-same-period-before-amp/m-p/1759781#M719038</guid>
      <dc:creator>Amelia_96</dc:creator>
      <dc:date>2020-11-20T18:58:42Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering data based on current date and same period (before &amp; after)</title>
      <link>https://community.qlik.com/t5/QlikView/Filtering-data-based-on-current-date-and-same-period-before-amp/m-p/1759807#M719039</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/128999"&gt;@Amelia_96&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Try like below&lt;/P&gt;&lt;P&gt;Let vStartDate = MakeDate(2020, 11,1);&lt;/P&gt;&lt;P&gt;Let vAfterDate = Interval(Today() - vStartDate, 'D');&lt;/P&gt;&lt;P&gt;Let vBeforeDate = vStartDate - vAfterDate;&lt;/P&gt;&lt;P&gt;LOAD Distinct&lt;BR /&gt;Date,&lt;BR /&gt;If(Date &amp;lt; Date('$(vStartDate)','YYYY-MM-DD'), 'Before', 'After') as Period&lt;BR /&gt;FROM&lt;BR /&gt;YourSource&lt;/P&gt;&lt;P&gt;&amp;nbsp;where Date &amp;gt;= Date($(vBeforeDate),'YYYY-MM-DD');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Nov 2020 11:15:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Filtering-data-based-on-current-date-and-same-period-before-amp/m-p/1759807#M719039</guid>
      <dc:creator>MayilVahanan</dc:creator>
      <dc:date>2020-11-09T11:15:47Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering data based on current date and same period (before &amp; after)</title>
      <link>https://community.qlik.com/t5/QlikView/Filtering-data-based-on-current-date-and-same-period-before-amp/m-p/1760623#M719040</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/17935"&gt;@MayilVahanan&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Nov 2020 09:49:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Filtering-data-based-on-current-date-and-same-period-before-amp/m-p/1760623#M719040</guid>
      <dc:creator>Amelia_96</dc:creator>
      <dc:date>2020-11-11T09:49:54Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering data based on current date and same period (before &amp; after)</title>
      <link>https://community.qlik.com/t5/QlikView/Filtering-data-based-on-current-date-and-same-period-before-amp/m-p/1761388#M719041</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/17935"&gt;@MayilVahanan&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to use this solution here, but it doesnt give the correct output.&lt;/P&gt;&lt;P&gt;Is there anything wrong with my code?&lt;/P&gt;&lt;P&gt;Let vStartDate = Date#(MakeDate(01,05,2020),'DDMMMYYYY:hh:mm:ss');&lt;/P&gt;&lt;P&gt;Let vLatestDate = Date#(MakeDate(16,09,2020),'DDMMMYYYY:hh:mm:ss');&lt;/P&gt;&lt;P&gt;Let vAfterDate = Interval(vLatestDate - vStartDate, 'D');&lt;/P&gt;&lt;P&gt;Let vBeforeDate = vStartDate - vAfterDate;&lt;/P&gt;&lt;P&gt;D1:&lt;BR /&gt;LOAD&amp;nbsp;&lt;BR /&gt;DTPROPENTRY,&lt;BR /&gt;If(DTPROPENTRY &amp;lt; Date('$(vStartDate)','YYYY-MM-DD'), 'Before', 'After') as PERIOD&lt;BR /&gt;FROM source&lt;BR /&gt;where Date#(DTPROPENTRY, 'DDMMMYYYY:hh:mm:ss') &amp;gt;= Date#('$(vBeforeDate)', 'DDMMMYYYY:hh:mm:ss');&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2020 07:24:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Filtering-data-based-on-current-date-and-same-period-before-amp/m-p/1761388#M719041</guid>
      <dc:creator>Amelia_96</dc:creator>
      <dc:date>2020-11-13T07:24:16Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering data based on current date and same period (before &amp; after)</title>
      <link>https://community.qlik.com/t5/QlikView/Filtering-data-based-on-current-date-and-same-period-before-amp/m-p/1761400#M719042</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/128999"&gt;@Amelia_96&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Can I know the reason for using&amp;nbsp;&lt;SPAN&gt;Date#() instead of date(). And for where condition, try with floor().&lt;BR /&gt;&lt;BR /&gt;Hope DTPROPENTRY field are in date format already.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;where Floor(DTPROPENTRY) &amp;gt;= Floor($(vBeforeDate));&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2020 05:01:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Filtering-data-based-on-current-date-and-same-period-before-amp/m-p/1761400#M719042</guid>
      <dc:creator>MayilVahanan</dc:creator>
      <dc:date>2020-11-13T05:01:23Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering data based on current date and same period (before &amp; after)</title>
      <link>https://community.qlik.com/t5/QlikView/Filtering-data-based-on-current-date-and-same-period-before-amp/m-p/1761414#M719043</link>
      <description>&lt;P&gt;Actually i'm still a bit confused on the formatting of date. So basically, the field DRPROPENTRY is text and in this form '01Jan2020:00:00:00'. So when i used your date from previous solution,&amp;nbsp; it can't be done because different format. Can you help me to suggest what is the best way on this matter?&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2020 06:31:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Filtering-data-based-on-current-date-and-same-period-before-amp/m-p/1761414#M719043</guid>
      <dc:creator>Amelia_96</dc:creator>
      <dc:date>2020-11-13T06:31:20Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering data based on current date and same period (before &amp; after)</title>
      <link>https://community.qlik.com/t5/QlikView/Filtering-data-based-on-current-date-and-same-period-before-amp/m-p/1761427#M719044</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/128999"&gt;@Amelia_96&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try like below&lt;BR /&gt;Where floor(Date#(&lt;SPAN&gt;DRPROPENTRY&amp;nbsp;&lt;/SPAN&gt;,'DDMMMYYYY:hh:mm:ss'))&lt;SPAN&gt;&amp;nbsp;&amp;gt;= Floor($(vBeforeDate));&lt;BR /&gt;&lt;BR /&gt;If not, pls share the sample file.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2020 07:00:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Filtering-data-based-on-current-date-and-same-period-before-amp/m-p/1761427#M719044</guid>
      <dc:creator>MayilVahanan</dc:creator>
      <dc:date>2020-11-13T07:00:40Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering data based on current date and same period (before &amp; after)</title>
      <link>https://community.qlik.com/t5/QlikView/Filtering-data-based-on-current-date-and-same-period-before-amp/m-p/1761430#M719045</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/17935"&gt;@MayilVahanan&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Still got issue.&lt;/P&gt;&lt;P&gt;Here's the sample file.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Really appreciate you assistance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2020 07:17:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Filtering-data-based-on-current-date-and-same-period-before-amp/m-p/1761430#M719045</guid>
      <dc:creator>Amelia_96</dc:creator>
      <dc:date>2020-11-13T07:17:39Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering data based on current date and same period (before &amp; after)</title>
      <link>https://community.qlik.com/t5/QlikView/Filtering-data-based-on-current-date-and-same-period-before-amp/m-p/1761437#M719046</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/128999"&gt;@Amelia_96&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Try like&amp;nbsp; below&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Let vStartDate = MakeDate(2020, 9,1);&lt;/P&gt;&lt;P&gt;Let vAfterDate = Interval(MakeDate(2020, 9,15) - Floor(vStartDate), 'D');&lt;/P&gt;&lt;P&gt;Let vBeforeDate = vStartDate - vAfterDate;&lt;/P&gt;&lt;P&gt;LOAD Date(Date#(DTPROPENTRY, 'DDMMMYYYY:hh:mm:ss')) as DTPROPENTRY,&lt;BR /&gt;If(Date(Date#(DTPROPENTRY, 'DDMMMYYYY:hh:mm:ss')) &amp;lt; Date('$(vStartDate)','YYYY-MM-DD'), 'Before', 'After') as Period&lt;BR /&gt;FROM&lt;BR /&gt;[D:\Qlik\personnal\Source.xlsx]&lt;BR /&gt;(ooxml, embedded labels, table is Source)&lt;BR /&gt;Where Date(Date#(DTPROPENTRY, 'DDMMMYYYY:hh:mm:ss')) &amp;gt;= Date($(vBeforeDate),'YYYY-MM-DD');;&lt;/P&gt;&lt;P&gt;You can change the dates below 2 values&lt;/P&gt;&lt;P&gt;Let vStartDate = MakeDate(2020, 9,1);&lt;/P&gt;&lt;P&gt;Let vAfterDate = Interval(MakeDate(2020, 9,15) - Floor(vStartDate), 'D');&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2020 07:39:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Filtering-data-based-on-current-date-and-same-period-before-amp/m-p/1761437#M719046</guid>
      <dc:creator>MayilVahanan</dc:creator>
      <dc:date>2020-11-13T07:39:38Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering data based on current date and same period (before &amp; after)</title>
      <link>https://community.qlik.com/t5/QlikView/Filtering-data-based-on-current-date-and-same-period-before-amp/m-p/1761450#M719047</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/17935"&gt;@MayilVahanan&lt;/a&gt;&amp;nbsp;! This is working.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2020 08:55:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Filtering-data-based-on-current-date-and-same-period-before-amp/m-p/1761450#M719047</guid>
      <dc:creator>Amelia_96</dc:creator>
      <dc:date>2020-11-13T08:55:28Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering data based on current date and same period (before &amp; after)</title>
      <link>https://community.qlik.com/t5/QlikView/Filtering-data-based-on-current-date-and-same-period-before-amp/m-p/1761452#M719048</link>
      <description>&lt;P&gt;I would try&lt;/P&gt;&lt;P&gt;table_new&lt;/P&gt;&lt;P&gt;NoConcatenate LOAD *,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; if(Date &amp;lt; Date('01.11.2020'), 'Before', 'After') as Period&lt;/P&gt;&lt;P&gt;Resident table_old;&lt;/P&gt;&lt;P&gt;Drop Table table_old&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With that you don't have to change your code, you just load the data from memory again, work with it and then drop the old stuff.&lt;/P&gt;&lt;P&gt;BUT, in general: don't use "Date" as field... since it's also a command, I would say that's bad programming style.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2020 09:02:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Filtering-data-based-on-current-date-and-same-period-before-amp/m-p/1761452#M719048</guid>
      <dc:creator>Frank_Kipry</dc:creator>
      <dc:date>2020-11-13T09:02:40Z</dc:date>
    </item>
  </channel>
</rss>

