<?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 Interval Match ( I think ) in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Interval-Match-I-think/m-p/800752#M282606</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have spent the last hour or so trying to figure this out with the help of the Community Pages and I finally call surrender.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a range of dates for various employees and an amount of time they are required to complete each week. Later in the script I have a time entry load which I intend to link to a time requirement table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My script is below where I load the requirements table 1st and then a calendar. I am looking to create a year, week, USERID key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Start date and End date span several years. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would someone please show me the way to expand the table to include for each user a year/week for every week in between START and END.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Rob&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;USER_REQ:&lt;/P&gt;&lt;P&gt;LOAD "TCC_USER" as USERID,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; floor("DATE_START") as START,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Floor(if(Len("DATE_END")=0,monthend(today()),"DATE_END")) as END,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; HOURS;&lt;/P&gt;&lt;P&gt;SQL SELECT *&lt;/P&gt;&lt;P&gt;FROM Qlikview.dbo."tbl_Time_Requirements";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let vStartDate=Floor(MakeDate(2014,1,1));&lt;/P&gt;&lt;P&gt;Let vEndDate=Floor(MonthEnd(Today()));&lt;/P&gt;&lt;P&gt;Let vDiff=vEndDate-vStartDate+1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Calendar:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp; DATE as DATEID,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Date(DATE) As DATE,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Day(DATE) as Day,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Week(DATE) as Week,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Month(DATE) as Month,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Year(DATE) As Year,&lt;/P&gt;&lt;P&gt;&amp;nbsp; WeekYear(DATE) as WeekYear,&lt;/P&gt;&lt;P&gt;&amp;nbsp; WeekYear(DATE) &amp;amp; '-' &amp;amp; Num(Week(DATE), '00') As YearWeek,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Date(MonthStart(DATE), 'YYYY-MMM') As YearMonth&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp; RecNo()-1+$(vStartDate) As DATE&lt;/P&gt;&lt;P&gt;AutoGenerate($(vDiff));&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 26 Mar 2015 15:48:21 GMT</pubDate>
    <dc:creator>racer25</dc:creator>
    <dc:date>2015-03-26T15:48:21Z</dc:date>
    <item>
      <title>Interval Match ( I think )</title>
      <link>https://community.qlik.com/t5/QlikView/Interval-Match-I-think/m-p/800752#M282606</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have spent the last hour or so trying to figure this out with the help of the Community Pages and I finally call surrender.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a range of dates for various employees and an amount of time they are required to complete each week. Later in the script I have a time entry load which I intend to link to a time requirement table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My script is below where I load the requirements table 1st and then a calendar. I am looking to create a year, week, USERID key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Start date and End date span several years. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would someone please show me the way to expand the table to include for each user a year/week for every week in between START and END.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Rob&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;USER_REQ:&lt;/P&gt;&lt;P&gt;LOAD "TCC_USER" as USERID,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; floor("DATE_START") as START,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Floor(if(Len("DATE_END")=0,monthend(today()),"DATE_END")) as END,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; HOURS;&lt;/P&gt;&lt;P&gt;SQL SELECT *&lt;/P&gt;&lt;P&gt;FROM Qlikview.dbo."tbl_Time_Requirements";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let vStartDate=Floor(MakeDate(2014,1,1));&lt;/P&gt;&lt;P&gt;Let vEndDate=Floor(MonthEnd(Today()));&lt;/P&gt;&lt;P&gt;Let vDiff=vEndDate-vStartDate+1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Calendar:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp; DATE as DATEID,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Date(DATE) As DATE,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Day(DATE) as Day,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Week(DATE) as Week,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Month(DATE) as Month,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Year(DATE) As Year,&lt;/P&gt;&lt;P&gt;&amp;nbsp; WeekYear(DATE) as WeekYear,&lt;/P&gt;&lt;P&gt;&amp;nbsp; WeekYear(DATE) &amp;amp; '-' &amp;amp; Num(Week(DATE), '00') As YearWeek,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Date(MonthStart(DATE), 'YYYY-MMM') As YearMonth&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp; RecNo()-1+$(vStartDate) As DATE&lt;/P&gt;&lt;P&gt;AutoGenerate($(vDiff));&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2015 15:48:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Interval-Match-I-think/m-p/800752#M282606</guid>
      <dc:creator>racer25</dc:creator>
      <dc:date>2015-03-26T15:48:21Z</dc:date>
    </item>
    <item>
      <title>Re: Interval Match ( I think )</title>
      <link>https://community.qlik.com/t5/QlikView/Interval-Match-I-think/m-p/800753#M282607</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;just an idea to expand the table with years and weeks (hope to understand)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;source:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;load * inline [&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;userid, start, end&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;1, 1/1/2015, 31/03/2015&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;2, 1/6/2012, 31/07/2012&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;3, 1/10/2012, 31/12/2012&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;4, 1/1/2011, 31/12/2011&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;];&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;final:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;load distinct userid, Year(date) as year, Week(date) as week;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;load &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; *,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; date(start + iterno()-1) as date&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Resident source&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;While (start + IterNo() -1) &amp;lt;= end;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;DROP Table source;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2015 21:08:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Interval-Match-I-think/m-p/800753#M282607</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2015-03-26T21:08:48Z</dc:date>
    </item>
  </channel>
</rss>

