<?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: Autogenerating dates within a fact table in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Autogenerating-dates-within-a-fact-table/m-p/686674#M248776</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Simen&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it was the outer join that I was missing...I now have a complete dataset...appreciate your time mate&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 18 Jul 2014 00:56:53 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-07-18T00:56:53Z</dc:date>
    <item>
      <title>Autogenerating dates within a fact table</title>
      <link>https://community.qlik.com/t5/QlikView/Autogenerating-dates-within-a-fact-table/m-p/686670#M248772</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 a fact table with four fields. &lt;/P&gt;&lt;P&gt;Area&lt;/P&gt;&lt;P&gt;District&lt;/P&gt;&lt;P&gt;Version&lt;/P&gt;&lt;P&gt;Design ID&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to add a date field to the fact table, with the result being one row per date, per combination of fact fields. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The purpose is to then add other data items to create a historical footprint, allowing for further analysis to be performed. the dates will start on 1/1/2013 and continue until today().&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;many thanks'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jul 2014 11:17:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Autogenerating-dates-within-a-fact-table/m-p/686670#M248772</guid>
      <dc:creator />
      <dc:date>2014-07-16T11:17:27Z</dc:date>
    </item>
    <item>
      <title>Re: Autogenerating dates within a fact table</title>
      <link>https://community.qlik.com/t5/QlikView/Autogenerating-dates-within-a-fact-table/m-p/686671#M248773</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rick,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this : (Suppose name of your date field is DateID)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let StartCalendar = num(MakeDate(year(today())-1, '01', '01'));&lt;/P&gt;&lt;P&gt;Let EndCalendar = num(YearEnd(today()));&lt;/P&gt;&lt;P&gt;//---------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Autogenerate Calendar with start and end Date&lt;/P&gt;&lt;P&gt;Cal:&lt;/P&gt;&lt;P&gt;LOAD Date ($(StartCalendar) + RecNo()-1) as CalDate&lt;/P&gt;&lt;P&gt;AutoGenerate ((today()-1) - $(StartCalendar)+1 );&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Left Join with no keys&lt;/P&gt;&lt;P&gt;left Join (Cal)&lt;/P&gt;&lt;P&gt;Load date(CalDate, 'DD-MMM-YYYY') as DateID&lt;/P&gt;&lt;P&gt;Resident Cal;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CAL:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DateID,&lt;/P&gt;&lt;P&gt;//&amp;nbsp;&amp;nbsp;&amp;nbsp; Date(SALES_DATE, 'DD/MM/YYYY') as SALES_DATE_1,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Month(DateID) as SALES_MONTH,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Year(DateID) as SALES_YEAR,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MonthName(DateID) as SALES_MONTHNAME,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Q' &amp;amp; Ceil(Month(DateID)/3) AS SALES_QUARTER,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DayNumberOfYear(DateID) as DayNumberOfYear,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Day(DateID) as DayNumberOfMonth,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DayNumberOfQuarter(DateID) as DayNumberOfQuarter,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; num(Month(DateID)) as MonthNum&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Resident Cal;&lt;/P&gt;&lt;P&gt;drop Table Cal;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;AS&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jul 2014 11:21:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Autogenerating-dates-within-a-fact-table/m-p/686671#M248773</guid>
      <dc:creator>amit_saini</dc:creator>
      <dc:date>2014-07-16T11:21:23Z</dc:date>
    </item>
    <item>
      <title>Re: Autogenerating dates within a fact table</title>
      <link>https://community.qlik.com/t5/QlikView/Autogenerating-dates-within-a-fact-table/m-p/686672#M248774</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the quick response amit &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a calendar generated, so no drama with that, but an trying to join the dates to the dataset.&lt;/P&gt;&lt;P&gt;I know memory can be&amp;nbsp; problem, but essentially I have 1000 rows of data, with 365 dates, then I expect to end up with a table with 365000 rows.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jul 2014 11:25:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Autogenerating-dates-within-a-fact-table/m-p/686672#M248774</guid>
      <dc:creator />
      <dc:date>2014-07-16T11:25:53Z</dc:date>
    </item>
    <item>
      <title>Re: Autogenerating dates within a fact table</title>
      <link>https://community.qlik.com/t5/QlikView/Autogenerating-dates-within-a-fact-table/m-p/686673#M248775</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not sure I understand your problem. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you want all your 1000 rows of data to exist for all 365 days?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if so:&lt;/P&gt;&lt;P&gt;let vStartDate = num(MakeDate(2013,1,1));&lt;/P&gt;&lt;P&gt;let vEndDate = num(Today());&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fact:&lt;/P&gt;&lt;P&gt;load &lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Area&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;District&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Version&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Design ID&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;from Fact.qvd (qvd);&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Dates:&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;load Date($(vStartDate) + RowNo()) as Date autogenerate $(vEndDate)-$(vStartDate);&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;outer join(Fact)&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;load * Resident Dates;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;drop table Dates;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It might not be 100% correct but should show you the concept. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;SKG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jul 2014 12:19:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Autogenerating-dates-within-a-fact-table/m-p/686673#M248775</guid>
      <dc:creator>simenkg</dc:creator>
      <dc:date>2014-07-16T12:19:10Z</dc:date>
    </item>
    <item>
      <title>Re: Autogenerating dates within a fact table</title>
      <link>https://community.qlik.com/t5/QlikView/Autogenerating-dates-within-a-fact-table/m-p/686674#M248776</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Simen&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it was the outer join that I was missing...I now have a complete dataset...appreciate your time mate&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jul 2014 00:56:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Autogenerating-dates-within-a-fact-table/m-p/686674#M248776</guid>
      <dc:creator />
      <dc:date>2014-07-18T00:56:53Z</dc:date>
    </item>
  </channel>
</rss>

