<?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 Joining a local table and a table from SQL to create a Fiscal Calendar in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Joining-a-local-table-and-a-table-from-SQL-to-create-a-Fiscal/m-p/1207600#M625756</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, I'm hoping someone can offer some assistance to this issue I'm having as I've come up against a wall.&lt;/P&gt;&lt;P&gt;My goal is to create a Fiscal Calendar. I previously had an excellent Fiscal Calendar created to suit our needs based on the fact that each Fiscal Period ended on the last Friday of each month. Fine.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Now I'm told that the business has decided to change some of the dates in this fiscal calendar to suit business needs, and they no longer fit a set pattern. They are however set up in our business system so I intend to create a fiscal calendar in Qlikview using data from a table in my Business System.&lt;/P&gt;&lt;P&gt;The table from my business system is as follows:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;FiscalPer&lt;/STRONG&gt;:&lt;/P&gt;&lt;P&gt;FiscalYear as [Fiscal Year],&lt;BR /&gt;FiscalPeriod as [Fiscal Period],&lt;BR /&gt;StartDate as [Fiscal Period Start Date],&lt;BR /&gt;EndDate as [Fiscal Period End Date]; &lt;/P&gt;&lt;P&gt;&lt;BR /&gt;The problem I have is that this basically only shows the following info in the table:&lt;/P&gt;&lt;P&gt;'2010', '1', '1/1/2010', 29/1/2010'&lt;BR /&gt;'2010', '2', '30/1/2010', 27/2/2010'&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;So I now create a Qlikview Calendar which includes the following information:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;FiscalCalendar&lt;/STRONG&gt;:&lt;/P&gt;&lt;P&gt;Load &lt;BR /&gt;Date(Date,'DD/MM/YYYY')&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as %Key_Calendar_Join_Date,&lt;BR /&gt;Dual(WeekDay(MonthEnd(Date)), Mod(3+WeekDay(MonthEnd(Date)),7)) as WeekDayMonthEnd,&lt;BR /&gt;Dual(WeekDay(MonthStart(Date)), Mod(2+WeekDay(MonthStart(Date)),7)) as WeekDayMonthStart,&lt;BR /&gt;WeekDay(Date) as WeekDay,&lt;BR /&gt;Month(Date) as CalendarMonth,&lt;BR /&gt;Year(Date) as CalendarYear,&lt;BR /&gt; *;&lt;BR /&gt;Load Date(RecNo()-1+MakeDate(2010)) as Date Autogenerate 10000; &lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I now have my two tables, but I want to join them, and this is where I have the issue. I need to have a table which includes all of the dates in FiscalCalendar, but also joins the information from FiscalPer to that, so the new table also includes the Fiscal Period for each date, as well as the start and end date of that fiscal period. &lt;BR /&gt;Can anyone please tell me how I do that?&lt;/P&gt;&lt;P&gt;Everything I have tried to date has failed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 03 Nov 2016 16:33:48 GMT</pubDate>
    <dc:creator />
    <dc:date>2016-11-03T16:33:48Z</dc:date>
    <item>
      <title>Joining a local table and a table from SQL to create a Fiscal Calendar</title>
      <link>https://community.qlik.com/t5/QlikView/Joining-a-local-table-and-a-table-from-SQL-to-create-a-Fiscal/m-p/1207600#M625756</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, I'm hoping someone can offer some assistance to this issue I'm having as I've come up against a wall.&lt;/P&gt;&lt;P&gt;My goal is to create a Fiscal Calendar. I previously had an excellent Fiscal Calendar created to suit our needs based on the fact that each Fiscal Period ended on the last Friday of each month. Fine.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Now I'm told that the business has decided to change some of the dates in this fiscal calendar to suit business needs, and they no longer fit a set pattern. They are however set up in our business system so I intend to create a fiscal calendar in Qlikview using data from a table in my Business System.&lt;/P&gt;&lt;P&gt;The table from my business system is as follows:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;FiscalPer&lt;/STRONG&gt;:&lt;/P&gt;&lt;P&gt;FiscalYear as [Fiscal Year],&lt;BR /&gt;FiscalPeriod as [Fiscal Period],&lt;BR /&gt;StartDate as [Fiscal Period Start Date],&lt;BR /&gt;EndDate as [Fiscal Period End Date]; &lt;/P&gt;&lt;P&gt;&lt;BR /&gt;The problem I have is that this basically only shows the following info in the table:&lt;/P&gt;&lt;P&gt;'2010', '1', '1/1/2010', 29/1/2010'&lt;BR /&gt;'2010', '2', '30/1/2010', 27/2/2010'&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;So I now create a Qlikview Calendar which includes the following information:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;FiscalCalendar&lt;/STRONG&gt;:&lt;/P&gt;&lt;P&gt;Load &lt;BR /&gt;Date(Date,'DD/MM/YYYY')&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as %Key_Calendar_Join_Date,&lt;BR /&gt;Dual(WeekDay(MonthEnd(Date)), Mod(3+WeekDay(MonthEnd(Date)),7)) as WeekDayMonthEnd,&lt;BR /&gt;Dual(WeekDay(MonthStart(Date)), Mod(2+WeekDay(MonthStart(Date)),7)) as WeekDayMonthStart,&lt;BR /&gt;WeekDay(Date) as WeekDay,&lt;BR /&gt;Month(Date) as CalendarMonth,&lt;BR /&gt;Year(Date) as CalendarYear,&lt;BR /&gt; *;&lt;BR /&gt;Load Date(RecNo()-1+MakeDate(2010)) as Date Autogenerate 10000; &lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I now have my two tables, but I want to join them, and this is where I have the issue. I need to have a table which includes all of the dates in FiscalCalendar, but also joins the information from FiscalPer to that, so the new table also includes the Fiscal Period for each date, as well as the start and end date of that fiscal period. &lt;BR /&gt;Can anyone please tell me how I do that?&lt;/P&gt;&lt;P&gt;Everything I have tried to date has failed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Nov 2016 16:33:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Joining-a-local-table-and-a-table-from-SQL-to-create-a-Fiscal/m-p/1207600#M625756</guid>
      <dc:creator />
      <dc:date>2016-11-03T16:33:48Z</dc:date>
    </item>
    <item>
      <title>Re: Joining a local table and a table from SQL to create a Fiscal Calendar</title>
      <link>https://community.qlik.com/t5/QlikView/Joining-a-local-table-and-a-table-from-SQL-to-create-a-Fiscal/m-p/1207601#M625757</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Jamie,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try this script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;//Your Source Data:&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;FiscalPer:&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;LOAD&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; * &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;INLINE&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[&lt;BR /&gt; FiscalYear, FiscalPeriod, StartDate, EndDate&lt;BR /&gt; 2010, 1, 01/01/2010, 29/01/2010&lt;BR /&gt; 2010, 2, 30/01/2010, 27/02/2010&lt;BR /&gt; 2010, 3, 28/02/2010, 30/03/2010&lt;BR /&gt; ]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;;&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;//loop through every period&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;For&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;i&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 0 &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;to&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;NoOfRows&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;('FiscalPer')-1&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;LET&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;vStartDate&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;peek&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;('StartDate', &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;$(i)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;, 'FiscalPer');&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;LET&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;vEndDate&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;peek&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;('EndDate', &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;$(i)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;, 'FiscalPer');&lt;BR /&gt; &lt;BR /&gt; FiscalCalendar: &lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;Load&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;TempDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Date&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Dual&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;WeekDay&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;MonthEnd&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;TempDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)), &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Mod&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(3+&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;WeekDay&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;MonthEnd&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;TempDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)),7)) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;WeekDayMonthEnd&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Dual&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;WeekDay&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;MonthStart&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;TempDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)), &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Mod&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(2+&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;WeekDay&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;MonthStart&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;TempDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)),7)) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;WeekDayMonthStart&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;WeekDay&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;TempDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;WeekDay&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Month&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;TempDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;CalendarMonth&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Year&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;TempDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;CalendarYear&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; ;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;//=== Generate a temp table of dates === &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;LOAD&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;date&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;mindate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; + &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;IterNo&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;()) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;AS&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;TempDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;WHILE&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;mindate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; + &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;IterNo&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;() &amp;lt;= &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;maxdate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;//=== Get min/max dates from Field ===/&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;LOAD&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; '$(vStartDate)'-1 &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;mindate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt; '$(vEndDate)' &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;maxdate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;AUTOGENERATE&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; 1;&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;next&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;i&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;//cleanup&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;drop&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;table&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; FiscalPer;&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;LET&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;i&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; =;&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;LET&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;vStartDate&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; =;&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;LET&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;vEndDate&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; =; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Nov 2016 09:02:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Joining-a-local-table-and-a-table-from-SQL-to-create-a-Fiscal/m-p/1207601#M625757</guid>
      <dc:creator>zhadrakas</dc:creator>
      <dc:date>2016-11-08T09:02:57Z</dc:date>
    </item>
    <item>
      <title>Re: Joining a local table and a table from SQL to create a Fiscal Calendar</title>
      <link>https://community.qlik.com/t5/QlikView/Joining-a-local-table-and-a-table-from-SQL-to-create-a-Fiscal/m-p/1207602#M625758</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FiscalPer&lt;/STRONG&gt;:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FiscalYear as [Fiscal Year],&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FiscalPeriod as [Fiscal Period],&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date(StartDate + IterNo() -1,'DD/MM/YYYY') as %Key_Calendar_Join_Date,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; StartDate as [Fiscal Period Start Date],&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; EndDate as [Fiscal Period End Date]&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; source_table&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;WHILE&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; StartDate + IterNo() -1 &amp;lt;= EndDate&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can then choose to leave the tables as they are since they will be associated correctly on the %Key_Calendar_Join_Date field. Or you could add additional fields in the FiscalPer table with a preceding load not create the FiscalCalendar table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Nov 2016 10:05:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Joining-a-local-table-and-a-table-from-SQL-to-create-a-Fiscal/m-p/1207602#M625758</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2016-11-08T10:05:51Z</dc:date>
    </item>
  </channel>
</rss>

