<?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: How to create dates when they don't exist in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-create-dates-when-they-don-t-exist/m-p/1077092#M359255</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So I am using an input box and filters related to master calendar so there are 2 ways to enter dates&lt;/P&gt;&lt;P&gt;The calendar is connected to the data via keys and analysis date&lt;/P&gt;&lt;P&gt;The idea to use a calendar was to NOT use set analysis - but in this case I believe I have to use both&lt;/P&gt;&lt;P&gt;Any suggestions?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Rick&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Data model.PNG" class="jive-image image-1" src="/legacyfs/online/116691_Data model.PNG" style="height: auto;" /&gt;&lt;IMG alt="input box.PNG" class="jive-image image-2" src="/legacyfs/online/116692_input box.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 02 Mar 2016 20:27:06 GMT</pubDate>
    <dc:creator>rarora12</dc:creator>
    <dc:date>2016-03-02T20:27:06Z</dc:date>
    <item>
      <title>How to create dates when they don't exist</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-create-dates-when-they-don-t-exist/m-p/1077089#M359252</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using a master calendar to have the user select dates.&lt;/P&gt;&lt;P&gt;The input from the user is used to look between ranges of dates, start and end.&lt;/P&gt;&lt;P&gt;I am using an iteration to generate dates from range start&amp;nbsp; to range end.&lt;/P&gt;&lt;P&gt;The while loop with the iteration runs for 20 mins and has 100 million rows.&lt;/P&gt;&lt;P&gt;I cannot use interval match as the Date is entered as an input and doesn't exist in the database.&lt;/P&gt;&lt;P&gt;Any ideas ?&lt;/P&gt;&lt;P&gt;Thanks for your input.&lt;/P&gt;&lt;P&gt;Rick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Mar 2016 19:17:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-create-dates-when-they-don-t-exist/m-p/1077089#M359252</guid>
      <dc:creator>rarora12</dc:creator>
      <dc:date>2016-03-02T19:17:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to create dates when they don't exist</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-create-dates-when-they-don-t-exist/m-p/1077090#M359253</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure if I understand what you are trying to achieve.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you post a small sample QVW with some mock up data or the script you are using?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Mar 2016 19:49:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-create-dates-when-they-don-t-exist/m-p/1077090#M359253</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-03-02T19:49:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to create dates when they don't exist</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-create-dates-when-they-don-t-exist/m-p/1077091#M359254</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;using a master calendar is generally achieved&amp;nbsp; by making&amp;nbsp; a connection (link) between you fact table (using facte date ) to your master calendare date .&lt;/P&gt;&lt;P&gt;tomake selection between to dates you can do that by using set analysis ..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Mar 2016 20:06:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-create-dates-when-they-don-t-exist/m-p/1077091#M359254</guid>
      <dc:creator>mohamed_ahid</dc:creator>
      <dc:date>2016-03-02T20:06:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to create dates when they don't exist</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-create-dates-when-they-don-t-exist/m-p/1077092#M359255</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So I am using an input box and filters related to master calendar so there are 2 ways to enter dates&lt;/P&gt;&lt;P&gt;The calendar is connected to the data via keys and analysis date&lt;/P&gt;&lt;P&gt;The idea to use a calendar was to NOT use set analysis - but in this case I believe I have to use both&lt;/P&gt;&lt;P&gt;Any suggestions?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Rick&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Data model.PNG" class="jive-image image-1" src="/legacyfs/online/116691_Data model.PNG" style="height: auto;" /&gt;&lt;IMG alt="input box.PNG" class="jive-image image-2" src="/legacyfs/online/116692_input box.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Mar 2016 20:27:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-create-dates-when-they-don-t-exist/m-p/1077092#M359255</guid>
      <dc:creator>rarora12</dc:creator>
      <dc:date>2016-03-02T20:27:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to create dates when they don't exist</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-create-dates-when-they-don-t-exist/m-p/1077093#M359256</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Rick, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I typically use some form of a Master Calendar script when building out my date functions. You are welcome to use this version that allows you to hard code in a start and end date for the range of your calendar. If you want to take it to the next level and make it more dynamic, you can change the Let statements below for the vMinDate and vMaxDate variables to any formula you like that results in a date value or numeric value that represents a date. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once you have this code added to your load script, you can join the Master Calendar into your existing data simply by aliasing a field in that dataset as either "Date" (for Date formatted fields) or "DateKey" (for Numeric Date fields).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope that this helps you, please let me know if you have additional questions, I would be happy to help further. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Mark&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// ==========================================================&lt;/P&gt;&lt;P&gt;// Master Calendar Generation Script&lt;/P&gt;&lt;P&gt;// ==========================================================&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vMinDate = Num(MakeDate(2016,1,1));&lt;/P&gt;&lt;P&gt;LET vMaxDate = Num(MakeDate(2016,12,31));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vNumberOfDays = Floor($(vMaxDate)) - Floor($(vMinDate)) + 1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Calendar:&lt;/P&gt;&lt;P&gt;LOAD Distinct &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; Num(Floor(Date)) as DateKey,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Date(Floor(Date)) as Date,&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; Month(Date) as Month,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Date(MonthStart(Date), 'MMM YYYY') as [Month and Year],&lt;/P&gt;&lt;P&gt;&amp;nbsp; Day(Date) as Day,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Year(YearStart(Date)) AS Year,&lt;/P&gt;&lt;P&gt;&amp;nbsp; 'Q'&amp;amp; Ceil(Month(Date)/3) AS Quarter,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Week(Date) as Week;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp; Date(Num($(vMaxDate)) - RecNo() + 1) as Date&lt;/P&gt;&lt;P&gt;AutoGenerate($(vNumberOfDays));&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Mar 2016 20:31:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-create-dates-when-they-don-t-exist/m-p/1077093#M359256</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-03-02T20:31:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to create dates when they don't exist</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-create-dates-when-they-don-t-exist/m-p/1077094#M359257</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the response and the script. So I am building a master calendar with a min and max date and I am populating the Supervision table with range of dates also with an iteration and while loop.&lt;/P&gt;&lt;P&gt;Then I am joining the calendar with the table with ranges using a common field name.. the link table&lt;/P&gt;&lt;P&gt;Appreciate the feedback and it seems that populating dense Dat in 2 places is needed.&lt;/P&gt;&lt;P&gt;The script runs for about 20 mins as it trying to build a calendar from 1985 to future year 2099.&lt;/P&gt;&lt;P&gt;Wish there was a way to tune the code for quicker reload..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks to all and I will keep you updated.&lt;/P&gt;&lt;P&gt;Rick &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Mar 2016 21:35:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-create-dates-when-they-don-t-exist/m-p/1077094#M359257</guid>
      <dc:creator>rarora12</dc:creator>
      <dc:date>2016-03-02T21:35:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to create dates when they don't exist</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-create-dates-when-they-don-t-exist/m-p/1077095#M359258</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using this, great script. Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 May 2018 13:43:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-create-dates-when-they-don-t-exist/m-p/1077095#M359258</guid>
      <dc:creator>megabyte23</dc:creator>
      <dc:date>2018-05-10T13:43:36Z</dc:date>
    </item>
  </channel>
</rss>

