<?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 Create a Date field in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Create-a-Date-field/m-p/270068#M1191299</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys!!!&lt;/P&gt;&lt;P&gt;I need some help...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have three Qvds.By concatenating them I am geting a&amp;nbsp; single table.Month and Year fields are present...but there is no date field (Day field).Data is geting uploaded on regular basis.I want to add a date field so that the user can see the difference between toady's data nd yesterday's data.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 11 Jul 2011 08:49:05 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-07-11T08:49:05Z</dc:date>
    <item>
      <title>Create a Date field</title>
      <link>https://community.qlik.com/t5/QlikView/Create-a-Date-field/m-p/270068#M1191299</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys!!!&lt;/P&gt;&lt;P&gt;I need some help...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have three Qvds.By concatenating them I am geting a&amp;nbsp; single table.Month and Year fields are present...but there is no date field (Day field).Data is geting uploaded on regular basis.I want to add a date field so that the user can see the difference between toady's data nd yesterday's data.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jul 2011 08:49:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-a-Date-field/m-p/270068#M1191299</guid>
      <dc:creator />
      <dc:date>2011-07-11T08:49:05Z</dc:date>
    </item>
    <item>
      <title>Create a Date field</title>
      <link>https://community.qlik.com/t5/QlikView/Create-a-Date-field/m-p/270069#M1191302</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Can you please share the script file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kaushik Solanki&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jul 2011 08:55:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-a-Date-field/m-p/270069#M1191302</guid>
      <dc:creator>kaushiknsolanki</dc:creator>
      <dc:date>2011-07-11T08:55:09Z</dc:date>
    </item>
    <item>
      <title>Re: Create a Date field</title>
      <link>https://community.qlik.com/t5/QlikView/Create-a-Date-field/m-p/270070#M1191303</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is the script.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jul 2011 09:16:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-a-Date-field/m-p/270070#M1191303</guid>
      <dc:creator />
      <dc:date>2011-07-11T09:16:47Z</dc:date>
    </item>
    <item>
      <title>Create a Date field</title>
      <link>https://community.qlik.com/t5/QlikView/Create-a-Date-field/m-p/270071#M1191304</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; You have used MakeDate function to create a date, but you have used only 2 parameter try with 3 Parameter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; The one which you used is.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MakeDate(NewYear,Daily.FinMonth) as DailyDashboardDate&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Make it as &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MakeDate(NewYear,Daily.FinMonth,1) as DailyDashboardDate;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; So here the first Parameter is Year, Second is Month and Third is Day.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kaushik Solanki&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jul 2011 09:30:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-a-Date-field/m-p/270071#M1191304</guid>
      <dc:creator>kaushiknsolanki</dc:creator>
      <dc:date>2011-07-11T09:30:57Z</dc:date>
    </item>
    <item>
      <title>Re: Create a Date field</title>
      <link>https://community.qlik.com/t5/QlikView/Create-a-Date-field/m-p/270072#M1191305</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For what it's worth here's no need for that, since MakeDate() will work fine with even one parameter (year) and will return the first possible value for that year.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;MakeDate(2011, 7)&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;will return the first day for year 2011 month 7. If you do have a field where you store the complete timestamp of the date, then yes, you could use that as the third parameter. All three parameters must be numeric.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But in any case, I'd create a unique date field in each table (using MakeDate will do) and link that to a master calendar table, where you have all the date dimensions (year, month, quarter, week, day, whatever else).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is what I'd do.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;Dump0:&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date(MakeDate(Year, Month)) AS Date,&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;FROM &lt;E&gt; (qvd);&lt;/E&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONCATENATE LOAD &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date(MakeDate(Year, Month)) AS Date,&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;FROM &lt;E&gt; (qvd);&lt;/E&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONCATENATE LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date(MakeDate(Year, Month)) AS Date,&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;FROM &lt;E&gt; (qvd)&lt;/E&gt;&lt;/P&gt;&lt;P&gt;WHERE Match(Class, 900, 700) &amp;gt; 0 AND Match(Code, 2000, 3800, 3810, 3900, 2100, 220, 2400, 2320, 2310, 2500, 2700, 2800, 2900, 3451, 3400, 3530, 3300, 2330) &amp;gt; 0;&lt;/P&gt;&lt;P&gt;// Using match() instead of the conditional, for clarity and perhaps performance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CalendarMinMax:&lt;/P&gt;&lt;P&gt;LOAD Max(Date) AS MaxDate,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Min(Date) AS MinDate&lt;/P&gt;&lt;P&gt;RESIDENT Dump0:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Getting highets and lowest possible values for actual dates&lt;/P&gt;&lt;P&gt;LET vMaxDate = FieldValue('MaxDate', 0);&lt;/P&gt;&lt;P&gt;LET vMinDate = FieldValue('MinDate', 0);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP TABLE CalendarMinMax;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Calendar:&lt;/P&gt;&lt;P&gt;LOAD Date($(vMinDate) + RowNo() -1) AS Date,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Year($(vMinDate) + RowNo() -1) AS Year,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Month($(vMinDate) + RowNo() -1) AS Month,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Week($(vMinDate) + RowNo() -1) AS Week,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ... // all the rest of required date dimensions&lt;/P&gt;&lt;P&gt;AUTOGENERATE $(vMaxDate) - $(vMinDate) +1;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I haven't tested the code and I may have made some syntax mispellings. Anyway, the idea is to have one table you can easily modify to add or remove date fields and a separte fact table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that makes sense and helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/people/mabaeyens" style="font-size: 12px; outline-style: none; padding-top: 1px; padding-bottom: 1px; padding-left: 17px; color: #007fc0; zoom: 1; text-decoration: underline; background-position: no-repeat no-repeat;"&gt;Miguel Angel Baeyens&lt;/A&gt;&lt;/P&gt;&lt;P&gt;BI Consultant&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://www.grupocomex.com/" style="font-size: 12px; outline-style: none; color: #007fc0;"&gt;Comex Grupo Ibérica&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jul 2011 09:54:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-a-Date-field/m-p/270072#M1191305</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2011-07-11T09:54:20Z</dc:date>
    </item>
    <item>
      <title>Re: Create a Date field</title>
      <link>https://community.qlik.com/t5/QlikView/Create-a-Date-field/m-p/270073#M1191306</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am not sure if u hv understood my problm completely..&lt;/P&gt;&lt;P&gt;Suppose i have uploaded data today...&lt;/P&gt;&lt;P&gt;then month nd Year are being fetched frm data itself....but I want to add day also.&lt;/P&gt;&lt;P&gt;since I have uploaded data today then the data should be stored at today's date (Month nd year fetched frm above nd Day will be relaod date.).Now again when i am loading data tomorrow then data should be saved at tomorrow's date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need this because i want to see increment from Yesterday's data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what i am planning is to do:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MonthName(MakeDate(NewYear,Daily.FinMonth,day(reloadtime())),3) as DailyDashboardMonthYear,&lt;/P&gt;&lt;P&gt;MakeDate(NewYear,Daily.FinMonth,day(reloadtime())) as DailyDashboardDate;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but this will nt wrk as previous 'Day' will get replaced by today's 'Day'&lt;/P&gt;&lt;P&gt;and not concatenated. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;M confused how sholud i do linking and all...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jul 2011 10:23:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-a-Date-field/m-p/270073#M1191306</guid>
      <dc:creator />
      <dc:date>2011-07-11T10:23:46Z</dc:date>
    </item>
    <item>
      <title>Re: Create a Date field</title>
      <link>https://community.qlik.com/t5/QlikView/Create-a-Date-field/m-p/270074#M1191308</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Erika,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I see two different things here: in one hand the "incremental" load based on some timestamp that is not in your database and depends on when the files are loaded and on the other hand the date dimensions used later in your charts and expressions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In regards to the code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;MonthName(MakeDate(NewYear, Daily.FinMonth, day(reloadtime())), 3) AS DailyDashboardMonthYear&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That will create a field with the values in NewYear, Daily.FinMonth and today's day number. If all that is meant to be "today", then why not using instead a cleaner and simpler &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;Date(Today()) AS Date&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can link that to the Calendar table where you have the month, monthname, and any other date related dimensions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In regards to the load, do you have in your data source some way to identify the complete date of the records so you can use that field in a WHERE clause?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can always do a two step load and store based on the code above, so you always load the QVD file, plus the records where date doesn't exist (something like &lt;A _jive_internal="true" href="https://community.qlik.com/message/131364#131364"&gt;this&lt;/A&gt;), or use a key field to load all records from your source except for those which key has been already loaded... Hence you always have a valid and complete date field you can use in your expressions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/people/mabaeyens" style="font-size: 12px; outline-style: none; padding-top: 1px; padding-bottom: 1px; padding-left: 17px; color: #007fc0; zoom: 1; text-decoration: underline; background-position: no-repeat no-repeat;"&gt;Miguel Angel Baeyens&lt;/A&gt;&lt;/P&gt;&lt;P&gt;BI Consultant&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://www.grupocomex.com/" style="font-size: 12px; outline-style: none; color: #007fc0;"&gt;Comex Grupo Ibérica&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jul 2011 10:50:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-a-Date-field/m-p/270074#M1191308</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2011-07-11T10:50:32Z</dc:date>
    </item>
  </channel>
</rss>

