<?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 Help with script resident join in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Help-with-script-resident-join/m-p/170988#M41187</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How would I do this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 04 Nov 2010 09:29:03 GMT</pubDate>
    <dc:creator>ivandrago</dc:creator>
    <dc:date>2010-11-04T09:29:03Z</dc:date>
    <item>
      <title>Help with script resident join</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-script-resident-join/m-p/170986#M41185</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have the below script, which basically gives a calendar for each personid for the dates between '01-JAN-2009' and previous day; but I need it changing, I want it to only show the date upto when that personid left the company and not sure how to do this, I have had a go under the orginal script but getting errors.&lt;/P&gt;&lt;P&gt;//Original Script&lt;/P&gt;&lt;P&gt;Cal_Tmp1:&lt;BR /&gt;Load&lt;BR /&gt;PersonId&lt;BR /&gt;Resident People;&lt;/P&gt;&lt;P&gt;Join LOAD&lt;BR /&gt; date,&lt;BR /&gt; date as DateForKey,&lt;BR /&gt; week,&lt;BR /&gt; month,&lt;BR /&gt; year,&lt;BR /&gt; [shift 1],&lt;BR /&gt; dow as [Day of Week],&lt;BR /&gt; [S1 Time];&lt;BR /&gt;SQL SELECT&lt;BR /&gt; convert(varchar,c.datekey,103) as date,&lt;BR /&gt; convert(varchar,right(convert(varchar,c.datekey,103),2))+'.'+case when len(c.weeknum) = 1 Then '0'+convert(varchar,c.weeknum) else convert(varchar,c.weeknum) end as week,&lt;BR /&gt; substring(datename(m,c.datekey),1,3)+'-'+substring(datename(yy,c.datekey),3,2) as month,&lt;BR /&gt; CalYear as year,&lt;BR /&gt; case when c.WeekdayNum between 1 and 5 then 1 else 0 end as [shift 1],&lt;BR /&gt; datename(dw,c.datekey) as dow,&lt;BR /&gt; case when c.WeekdayNum between 1 and 5 then 7.5 else 0 end as [S1 Time]&lt;BR /&gt;From&lt;BR /&gt; dimCalendar c&lt;BR /&gt;where&lt;BR /&gt; c.datekey between '01-JAN-2009' and dateadd(d,-1,getdate()) ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//New Script&lt;/P&gt;&lt;P&gt;Cal_Tmp1:&lt;BR /&gt;Load&lt;BR /&gt;PersonId&lt;BR /&gt;Resident People;&lt;/P&gt;&lt;P&gt;Join LOAD&lt;BR /&gt; date,&lt;BR /&gt; date as DateForKey,&lt;BR /&gt; week,&lt;BR /&gt; month,&lt;BR /&gt; year,&lt;BR /&gt; [shift 1],&lt;BR /&gt; dow as [Day of Week],&lt;BR /&gt; [S1 Time];&lt;BR /&gt;SQL SELECT&lt;BR /&gt; convert(varchar,c.datekey,103) as date,&lt;BR /&gt; convert(varchar,right(convert(varchar,c.datekey,103),2))+'.'+case when len(c.weeknum) = 1 Then '0'+convert(varchar,c.weeknum) else convert(varchar,c.weeknum) end as week,&lt;BR /&gt; substring(datename(m,c.datekey),1,3)+'-'+substring(datename(yy,c.datekey),3,2) as month,&lt;BR /&gt; CalYear as year,&lt;BR /&gt; case when c.WeekdayNum between 1 and 5 then 1 else 0 end as [shift 1],&lt;BR /&gt; datename(dw,c.datekey) as dow,&lt;BR /&gt; case when c.WeekdayNum between 1 and 5 then 7.5 else 0 end as [S1 Time]&lt;BR /&gt;From&lt;BR /&gt; Calendar c cross join User p left join PersonLogin pl&lt;BR /&gt;on p.personid = pl.login left join person pe&lt;BR /&gt;on pl.userid = pe.userid&lt;BR /&gt;&lt;BR /&gt;where&lt;BR /&gt; c.datekey between '01-JAN-2009' and case when pe.terminationdate is null then dateadd(d,-1,getdate()) else pe.terminationdate end;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Nov 2010 23:50:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-script-resident-join/m-p/170986#M41185</guid>
      <dc:creator>ivandrago</dc:creator>
      <dc:date>2010-11-03T23:50:07Z</dc:date>
    </item>
    <item>
      <title>Help with script resident join</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-script-resident-join/m-p/170987#M41186</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you thought about changing your strategy to include the beginning and end date in the table People and then doing a intervalmatch between the that table and the master calendar table?&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Nov 2010 00:15:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-script-resident-join/m-p/170987#M41186</guid>
      <dc:creator>pover</dc:creator>
      <dc:date>2010-11-04T00:15:38Z</dc:date>
    </item>
    <item>
      <title>Help with script resident join</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-script-resident-join/m-p/170988#M41187</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How would I do this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Nov 2010 09:29:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-script-resident-join/m-p/170988#M41187</guid>
      <dc:creator>ivandrago</dc:creator>
      <dc:date>2010-11-04T09:29:03Z</dc:date>
    </item>
    <item>
      <title>Help with script resident join</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-script-resident-join/m-p/170989#M41188</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ivan,&lt;/P&gt;&lt;P&gt;Here is an example. Instead of Start and Stop you would use Start Date and End Date in your example. The time field would then be you date field from your master calendar.&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 06 Nov 2010 22:39:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-script-resident-join/m-p/170989#M41188</guid>
      <dc:creator>pover</dc:creator>
      <dc:date>2010-11-06T22:39:43Z</dc:date>
    </item>
  </channel>
</rss>

