<?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 Working with FACT Date Timestamp Data - Tips &amp; Best Practice Advice in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Working-with-FACT-Date-Timestamp-Data-Tips-Best-Practice-Advice/m-p/458310#M171104</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is the best practice for working with date time stamp data in fact tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H3&gt;Calculating Time Durations&lt;/H3&gt;&lt;P&gt;Let us say that we have a fact table (&amp;gt; 100,000 records) with a number (ten or more) of fields containing date timestamp data (for example 2/08/2006 7:07:00 PM).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I want to caluclate the duration between a number of these fields should I;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Create additional columns and perform these calculations in the LOAD statement&lt;/LI&gt;&lt;LI&gt;Calculate these values in chart s'on the fly'&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;H3&gt;Grouping Date Timestamps&lt;/H3&gt;&lt;P&gt;What about grouping these dates?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let us say we have the following date timestamps for the first 4 records in our fact table;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;2/08/2006 7:07:00 PM&lt;/LI&gt;&lt;LI&gt;2/08/2006 7:09:00 PM&lt;/LI&gt;&lt;LI&gt;2/08/2006 7:12:00 PM&lt;/LI&gt;&lt;LI&gt;2/08/2006 7:13:00 PM&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to report these on a 'Day', 'Month' and 'Year' basis and would need to aggregate them accordingly. Should I;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Create additional columns and convert these records in the LOAD statement&lt;UL&gt;&lt;LI&gt;For example a 'YEAR(field_name)' statement would convert all the records to 2006 and store them in a YEAR column&lt;/LI&gt;&lt;LI&gt;I would need 4 fields probably&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;DAY&lt;/STRONG&gt;, &lt;STRONG&gt;MONTH&lt;/STRONG&gt;, &lt;STRONG&gt;YEAR &lt;/STRONG&gt;and &lt;STRONG&gt;DAY_MONTH_YEAR&lt;/STRONG&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;Calculate these values in charts 'on the fly'&lt;/LI&gt;&lt;LI&gt;Create a DIM table and refer to this&lt;UL&gt;&lt;LI&gt;Obviously this wouldn't go down to individual minutes but it could go down to day granularity&lt;/LI&gt;&lt;LI&gt;i could then round the date time stamp I have 'on the fly' when it is required (in charts) and derive MONTH and YEAR values from there&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;Possibly a mixture of 1. and 3.&lt;UL&gt;&lt;LI&gt;Convert to a day in the LOAD statement&lt;/LI&gt;&lt;LI&gt;Use this field to refer to the DIM table to get aother data&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 11 Jun 2013 05:23:09 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-06-11T05:23:09Z</dc:date>
    <item>
      <title>Working with FACT Date Timestamp Data - Tips &amp; Best Practice Advice</title>
      <link>https://community.qlik.com/t5/QlikView/Working-with-FACT-Date-Timestamp-Data-Tips-Best-Practice-Advice/m-p/458310#M171104</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is the best practice for working with date time stamp data in fact tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H3&gt;Calculating Time Durations&lt;/H3&gt;&lt;P&gt;Let us say that we have a fact table (&amp;gt; 100,000 records) with a number (ten or more) of fields containing date timestamp data (for example 2/08/2006 7:07:00 PM).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I want to caluclate the duration between a number of these fields should I;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Create additional columns and perform these calculations in the LOAD statement&lt;/LI&gt;&lt;LI&gt;Calculate these values in chart s'on the fly'&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;H3&gt;Grouping Date Timestamps&lt;/H3&gt;&lt;P&gt;What about grouping these dates?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let us say we have the following date timestamps for the first 4 records in our fact table;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;2/08/2006 7:07:00 PM&lt;/LI&gt;&lt;LI&gt;2/08/2006 7:09:00 PM&lt;/LI&gt;&lt;LI&gt;2/08/2006 7:12:00 PM&lt;/LI&gt;&lt;LI&gt;2/08/2006 7:13:00 PM&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to report these on a 'Day', 'Month' and 'Year' basis and would need to aggregate them accordingly. Should I;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Create additional columns and convert these records in the LOAD statement&lt;UL&gt;&lt;LI&gt;For example a 'YEAR(field_name)' statement would convert all the records to 2006 and store them in a YEAR column&lt;/LI&gt;&lt;LI&gt;I would need 4 fields probably&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;DAY&lt;/STRONG&gt;, &lt;STRONG&gt;MONTH&lt;/STRONG&gt;, &lt;STRONG&gt;YEAR &lt;/STRONG&gt;and &lt;STRONG&gt;DAY_MONTH_YEAR&lt;/STRONG&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;Calculate these values in charts 'on the fly'&lt;/LI&gt;&lt;LI&gt;Create a DIM table and refer to this&lt;UL&gt;&lt;LI&gt;Obviously this wouldn't go down to individual minutes but it could go down to day granularity&lt;/LI&gt;&lt;LI&gt;i could then round the date time stamp I have 'on the fly' when it is required (in charts) and derive MONTH and YEAR values from there&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;Possibly a mixture of 1. and 3.&lt;UL&gt;&lt;LI&gt;Convert to a day in the LOAD statement&lt;/LI&gt;&lt;LI&gt;Use this field to refer to the DIM table to get aother data&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Jun 2013 05:23:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Working-with-FACT-Date-Timestamp-Data-Tips-Best-Practice-Advice/m-p/458310#M171104</guid>
      <dc:creator />
      <dc:date>2013-06-11T05:23:09Z</dc:date>
    </item>
    <item>
      <title>Re: Working with FACT Date Timestamp Data - Tips &amp; Best Practice Advice</title>
      <link>https://community.qlik.com/t5/QlikView/Working-with-FACT-Date-Timestamp-Data-Tips-Best-Practice-Advice/m-p/458311#M171105</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 TIME DURATIONS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For calculating TIME DURATIONs, check for Interval Function, that will help you identify the difference in Days and Hours.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try doing it at the Load script as much as possible because, that way the result are available for computation later in charts. Doing it at chart level will lead to more calculations/ memmory issue while the chart is loading.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GROUPING TIME DURATIONS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For Groping Time Durations, u can create an Additional Date Fields using Date(Floor(DateField)) As NewDateField syntax in Load Script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Again to create different Time Dimensions, you can create a Master Calendar in your data model. search for Master Calendar in Community (&lt;A _jive_internal="true" href="https://community.qlik.com/blogs/qlikviewdesignblog/2012/10/16/the-master-calendar"&gt;http://community.qlik.com/blogs/qlikviewdesignblog/2012/10/16/the-master-calendar&lt;/A&gt;).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.... &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Jun 2013 07:09:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Working-with-FACT-Date-Timestamp-Data-Tips-Best-Practice-Advice/m-p/458311#M171105</guid>
      <dc:creator>amars</dc:creator>
      <dc:date>2013-06-11T07:09:07Z</dc:date>
    </item>
  </channel>
</rss>

