<?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: Date comparison issue in qlik script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Date-comparison-issue-in-qlik-script/m-p/1788453#M1210293</link>
    <description>&lt;P&gt;this is actually working the way it is coded. because it is not pulling weekend dates greater than max date&lt;/P&gt;&lt;P&gt;is maxdate a required field?&amp;nbsp; or is it there just to ensure the weekend date is between the start and end date?&amp;nbsp; is date required as well?&amp;nbsp; can you give sample source data and expected result?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 04 Mar 2021 16:44:12 GMT</pubDate>
    <dc:creator>edwin</dc:creator>
    <dc:date>2021-03-04T16:44:12Z</dc:date>
    <item>
      <title>Date comparison issue in qlik script</title>
      <link>https://community.qlik.com/t5/QlikView/Date-comparison-issue-in-qlik-script/m-p/1788384#M1210286</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;hi all,&lt;/P&gt;&lt;P&gt;I have dates as below , iam actually writing below script to load the Date ,GCIO_Weekend_Date which are less than or equal to Max_Date for each record but some dates are not returned , please help if anything need to be corrected here&lt;/P&gt;&lt;P&gt;GCIO_Dates:&lt;BR /&gt;LOAD [CR number],&lt;BR /&gt;Date,&lt;BR /&gt;Max_Date,&lt;BR /&gt;GCIO_Weekend_Date&lt;BR /&gt;Resident GCIO_All_Dates where GCIO_Weekend_Date &amp;lt;= Max_Date;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="chaitanyajami_1-1614870704049.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/50459iDE06D5804BF7EAC8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="chaitanyajami_1-1614870704049.png" alt="chaitanyajami_1-1614870704049.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;after execution&amp;nbsp; getting missing dates for few records&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="chaitanyajami_2-1614871039194.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/50461i8BA935A3D93DC32C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="chaitanyajami_2-1614871039194.png" alt="chaitanyajami_2-1614871039194.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Mar 2021 15:18:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-comparison-issue-in-qlik-script/m-p/1788384#M1210286</guid>
      <dc:creator>chaitanyajami</dc:creator>
      <dc:date>2021-03-04T15:18:27Z</dc:date>
    </item>
    <item>
      <title>Re: Date comparison issue in qlik script</title>
      <link>https://community.qlik.com/t5/QlikView/Date-comparison-issue-in-qlik-script/m-p/1788427#M1210289</link>
      <description>&lt;P&gt;sample data would be most helpful&lt;/P&gt;</description>
      <pubDate>Thu, 04 Mar 2021 15:59:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-comparison-issue-in-qlik-script/m-p/1788427#M1210289</guid>
      <dc:creator>edwin</dc:creator>
      <dc:date>2021-03-04T15:59:54Z</dc:date>
    </item>
    <item>
      <title>Re: Date comparison issue in qlik script</title>
      <link>https://community.qlik.com/t5/QlikView/Date-comparison-issue-in-qlik-script/m-p/1788431#M1210290</link>
      <description>&lt;P&gt;i think i see it.&amp;nbsp; those dates are not pulled in bec of this where:&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;GCIO_Weekend_Date &amp;lt;= Max_Date;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;if you explain what you are trying to do or what the business rules are it might help&lt;/P&gt;</description>
      <pubDate>Thu, 04 Mar 2021 16:02:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-comparison-issue-in-qlik-script/m-p/1788431#M1210290</guid>
      <dc:creator>edwin</dc:creator>
      <dc:date>2021-03-04T16:02:49Z</dc:date>
    </item>
    <item>
      <title>Re: Date comparison issue in qlik script</title>
      <link>https://community.qlik.com/t5/QlikView/Date-comparison-issue-in-qlik-script/m-p/1788436#M1210291</link>
      <description>&lt;P&gt;Hi ,actually for each cr number mentioned below there is a start and end date and I have generated the dates between the start and end date and for each date I'm returning the weekend date and also for each cr I'm getting max date ,so I want to load the weekend dates for each cr which are less than the max date so I'm comparing the weekend date with the max date for each cr but it's breaking.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;GCIO_Dates:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LOAD [CR number],&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Date,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Max_Date,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;GCIO_Weekend_Date&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Resident GCIO_All_Dates where GCIO_Weekend_Date &amp;lt;= Max_Date;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Mar 2021 16:11:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-comparison-issue-in-qlik-script/m-p/1788436#M1210291</guid>
      <dc:creator>chaitanyajami</dc:creator>
      <dc:date>2021-03-04T16:11:03Z</dc:date>
    </item>
    <item>
      <title>Re: Date comparison issue in qlik script</title>
      <link>https://community.qlik.com/t5/QlikView/Date-comparison-issue-in-qlik-script/m-p/1788453#M1210293</link>
      <description>&lt;P&gt;this is actually working the way it is coded. because it is not pulling weekend dates greater than max date&lt;/P&gt;&lt;P&gt;is maxdate a required field?&amp;nbsp; or is it there just to ensure the weekend date is between the start and end date?&amp;nbsp; is date required as well?&amp;nbsp; can you give sample source data and expected result?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Mar 2021 16:44:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-comparison-issue-in-qlik-script/m-p/1788453#M1210293</guid>
      <dc:creator>edwin</dc:creator>
      <dc:date>2021-03-04T16:44:12Z</dc:date>
    </item>
    <item>
      <title>Re: Date comparison issue in qlik script</title>
      <link>https://community.qlik.com/t5/QlikView/Date-comparison-issue-in-qlik-script/m-p/1788471#M1210294</link>
      <description>&lt;P&gt;attached the sample data , below is the requirement&amp;nbsp;&lt;/P&gt;&lt;P&gt;i need to find out the weekend dates impacted by the cr number&amp;nbsp; so iam first extracted the dates from the timestamp by below&lt;/P&gt;&lt;P&gt;[CR number]&lt;/P&gt;&lt;P&gt;Date(Floor([Scheduled Start (UTC)]),'DD/MM/YYYY') as [Scheduled Start],&lt;BR /&gt;Date(Floor([Scheduled End (UTC)]),'DD/MM/YYYY') as [Scheduled End],&lt;/P&gt;&lt;P&gt;after that im generating the dates between start and end date and trying to find out the max date&amp;nbsp;&lt;/P&gt;&lt;P&gt;and from there im trying to generate the weekend for the each date but suppose there is a cr started on today 04/03/2021 and ended on 10/03/2021 when i generate the dates and weekend dates below is the output&lt;/P&gt;&lt;P&gt;04/03/2021,07/03/2021&lt;/P&gt;&lt;P&gt;05/03/2021,07/03/2021&lt;/P&gt;&lt;P&gt;06/03/2021,07/03/2021&lt;/P&gt;&lt;P&gt;07/03/2021,07/03/2021&lt;/P&gt;&lt;P&gt;08/03/2021,14/03/2021&lt;/P&gt;&lt;P&gt;09/03/2021,14/03/2021&lt;/P&gt;&lt;P&gt;10/03/2021,14/03/2021&lt;/P&gt;&lt;P&gt;as per the data CR is closed on 10th feb so i dont want to report the weekend date 14/03/2021 for the i have used the condition Weekend date &amp;lt;= Max date which is 10/03/2021 in the above case&lt;/P&gt;&lt;P&gt;below is the code&amp;nbsp;&lt;/P&gt;&lt;P&gt;GCIO_All_Dates_Temp:&lt;BR /&gt;LOAD [CR number],&lt;/P&gt;&lt;P&gt;if ([Scheduled Start (UTC)] = [Scheduled End (UTC)],[Scheduled End (UTC)],Date([Scheduled Start (UTC)]+iterno()-1)) as Date&lt;/P&gt;&lt;P&gt;resident GCIO while [Scheduled Start (UTC)]+IterNo()-1 &amp;lt;= [Scheduled End (UTC)];&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;left join (GCIO_All_Dates_Temp)&lt;/P&gt;&lt;P&gt;Max_Date:&lt;BR /&gt;Load [CR number],&lt;BR /&gt;Date(Max(Date),'DD/MM/YYYY')as Max_Date&lt;BR /&gt;Resident GCIO_All_Dates_Temp group by [CR number] ;&lt;/P&gt;&lt;P&gt;GCIO_All_Dates:&lt;BR /&gt;LOAD [CR number],&lt;BR /&gt;Date,&lt;BR /&gt;Max_Date,&lt;BR /&gt;Date(Floor(WeekEnd(Date,0,0))) as GCIO_Weekend_Date&lt;BR /&gt;Resident GCIO_All_Dates_Temp;&lt;BR /&gt;&lt;BR /&gt;Drop table GCIO_All_Dates_Temp ;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;NoConcatenate&lt;/P&gt;&lt;P&gt;GCIO_Dates:&lt;BR /&gt;LOAD [CR number],&lt;BR /&gt;Date,&lt;BR /&gt;Max_Date,&lt;BR /&gt;GCIO_Weekend_Date&lt;BR /&gt;Resident GCIO_All_Dates where GCIO_Weekend_Date &amp;lt;= Max_Date;&lt;/P&gt;&lt;P&gt;Drop Table GCIO_All_Dates;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Mar 2021 17:18:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-comparison-issue-in-qlik-script/m-p/1788471#M1210294</guid>
      <dc:creator>chaitanyajami</dc:creator>
      <dc:date>2021-03-04T17:18:42Z</dc:date>
    </item>
    <item>
      <title>Re: Date comparison issue in qlik script</title>
      <link>https://community.qlik.com/t5/QlikView/Date-comparison-issue-in-qlik-script/m-p/1788491#M1210296</link>
      <description>&lt;LI-CODE lang="markup"&gt;Dates:
load 'CR' &amp;amp; rowno() as CR, * inline [
start, end
04/03/2021,07/03/2021
05/03/2021,07/03/2021
06/03/2021,07/03/2021
07/03/2021,07/03/2021
08/03/2021,14/03/2021
09/03/2021,14/03/2021
10/03/2021,14/03/2021
];

//thsi is to frame the start and end dates
NoConcatenate minmax: load date(min(start)) as minDate, date(max(start)) as maxDate Resident Dates;
Concatenate (minmax) load date(min(end)) as minDate, date(max(end)) as maxDate Resident Dates;

//this joins the start end dates with teh individual dates cartesian; 
//then it filters for dates within teh range
inner join (Dates)
load Date(MinDate + iterno()-1) as Date, weekday(Date(MinDate + iterno()-1)) as Day, if(match(weekday(Date(MinDate + iterno()-1)),'Sat','Sun')&amp;gt;0, 'WeekEnd','WeekDay') as WeekEndOrNot
while Date(MinDate + iterno()-1) &amp;lt;=MaxDate;
load date(min(minDate)) as MinDate, date(max(maxDate)) as MaxDate resident minmax;


//filters out non-weekend
NoConcatenate NewData:
load * resident Dates where Date &amp;gt;=start and Date&amp;lt;=end and WeekEndOrNot = 'WeekEnd';

drop table minmax, Dates;&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 04 Mar 2021 18:45:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-comparison-issue-in-qlik-script/m-p/1788491#M1210296</guid>
      <dc:creator>edwin</dc:creator>
      <dc:date>2021-03-04T18:45:00Z</dc:date>
    </item>
    <item>
      <title>Re: Date comparison issue in qlik script</title>
      <link>https://community.qlik.com/t5/QlikView/Date-comparison-issue-in-qlik-script/m-p/1788493#M1210297</link>
      <description />
      <pubDate>Thu, 04 Mar 2021 18:48:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-comparison-issue-in-qlik-script/m-p/1788493#M1210297</guid>
      <dc:creator>edwin</dc:creator>
      <dc:date>2021-03-04T18:48:17Z</dc:date>
    </item>
    <item>
      <title>Re: Date comparison issue in qlik script</title>
      <link>https://community.qlik.com/t5/QlikView/Date-comparison-issue-in-qlik-script/m-p/1788616#M1210314</link>
      <description>&lt;P&gt;Thank you very much Edwin, it worked perfect for me&lt;/P&gt;</description>
      <pubDate>Fri, 05 Mar 2021 09:12:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-comparison-issue-in-qlik-script/m-p/1788616#M1210314</guid>
      <dc:creator>chaitanyajami</dc:creator>
      <dc:date>2021-03-05T09:12:10Z</dc:date>
    </item>
    <item>
      <title>Re: Date comparison issue in qlik script</title>
      <link>https://community.qlik.com/t5/QlikView/Date-comparison-issue-in-qlik-script/m-p/1788699#M1210335</link>
      <description>&lt;P&gt;yw&lt;/P&gt;</description>
      <pubDate>Fri, 05 Mar 2021 14:06:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-comparison-issue-in-qlik-script/m-p/1788699#M1210335</guid>
      <dc:creator>edwin</dc:creator>
      <dc:date>2021-03-05T14:06:04Z</dc:date>
    </item>
  </channel>
</rss>

