<?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 Timestamp as a Number - How many Decimal Places? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Timestamp-as-a-Number-How-many-Decimal-Places/m-p/876966#M306247</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am attempting to build a Master Calendar at an Hourly granularity, using a timestamp as the joining Key. The key value is generated via:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ($(vMinDate) + (rowno()*(1/24)) -1) as TempDateTime&lt;/P&gt;&lt;P&gt;AutoGenerate&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ((($(vMaxDate))-$(vMinDate) +1)*24);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Data in the Fact table generates the equivalent numeric timestamp value thus:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; floor(num#( DATETIME),1/24) as [DateTimeKey],&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The data is from an Oracle Database originally, but is loaded from QVD at this stage.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, This key value is sometimes failing to associate properly - the generated numeric values look correct, but QV is failing to make the association....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="MasterCal.JPG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/87885_MasterCal.JPG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;nb. I have forced the DateTimeKey column to display as numeric&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, is the value generated in the calendar generated to a different number of decimal places to the one generated by the floor function? Would this be fixed by rounding one or both of them?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 29 May 2015 09:22:35 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-05-29T09:22:35Z</dc:date>
    <item>
      <title>Timestamp as a Number - How many Decimal Places?</title>
      <link>https://community.qlik.com/t5/QlikView/Timestamp-as-a-Number-How-many-Decimal-Places/m-p/876966#M306247</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am attempting to build a Master Calendar at an Hourly granularity, using a timestamp as the joining Key. The key value is generated via:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ($(vMinDate) + (rowno()*(1/24)) -1) as TempDateTime&lt;/P&gt;&lt;P&gt;AutoGenerate&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ((($(vMaxDate))-$(vMinDate) +1)*24);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Data in the Fact table generates the equivalent numeric timestamp value thus:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; floor(num#( DATETIME),1/24) as [DateTimeKey],&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The data is from an Oracle Database originally, but is loaded from QVD at this stage.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, This key value is sometimes failing to associate properly - the generated numeric values look correct, but QV is failing to make the association....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="MasterCal.JPG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/87885_MasterCal.JPG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;nb. I have forced the DateTimeKey column to display as numeric&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, is the value generated in the calendar generated to a different number of decimal places to the one generated by the floor function? Would this be fixed by rounding one or both of them?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 May 2015 09:22:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Timestamp-as-a-Number-How-many-Decimal-Places/m-p/876966#M306247</guid>
      <dc:creator />
      <dc:date>2015-05-29T09:22:35Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamp as a Number - How many Decimal Places?</title>
      <link>https://community.qlik.com/t5/QlikView/Timestamp-as-a-Number-How-many-Decimal-Places/m-p/876967#M306248</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's certainly possible that the generated fractions differ. See this blog post: &lt;A href="https://community.qlik.com/qlik-blogpost/3471"&gt;Rounding Errors&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You could try using the floor function on the generated timestamps as well:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;LOAD&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; floor(($(vMinDate) + (rowno()*(1/24)) -1),1/24) as TempDateTime&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;AutoGenerate&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ((($(vMaxDate))-$(vMinDate) +1)*24);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 May 2015 15:23:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Timestamp-as-a-Number-How-many-Decimal-Places/m-p/876967#M306248</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2015-05-29T15:23:00Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamp as a Number - How many Decimal Places?</title>
      <link>https://community.qlik.com/t5/QlikView/Timestamp-as-a-Number-How-many-Decimal-Places/m-p/876968#M306249</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;I once had a similar issue and used a round(timestamp, 1/24) function instead in order to get the nearest full-hour timestamp.&lt;/P&gt;&lt;P&gt;hope this helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 May 2015 15:28:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Timestamp-as-a-Number-How-many-Decimal-Places/m-p/876968#M306249</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2015-05-29T15:28:07Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamp as a Number - How many Decimal Places?</title>
      <link>https://community.qlik.com/t5/QlikView/Timestamp-as-a-Number-How-many-Decimal-Places/m-p/876969#M306250</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Comparing floating point values can make you a hard time...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe try this approach taken from Rob's blog:&lt;/P&gt;&lt;P&gt;&lt;A href="http://qlikviewcookbook.com/2011/10/correct-time-arithmetic/" title="http://qlikviewcookbook.com/2011/10/correct-time-arithmetic/"&gt;Correct Time Arithmetic | Qlikview Cookbook&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 May 2015 15:41:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Timestamp-as-a-Number-How-many-Decimal-Places/m-p/876969#M306250</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2015-05-29T15:41:24Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamp as a Number - How many Decimal Places?</title>
      <link>https://community.qlik.com/t5/QlikView/Timestamp-as-a-Number-How-many-Decimal-Places/m-p/876970#M306251</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I really need to retain the floor functionality, rather than round. However attempting to wrap the Calendar in the floor function:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;floor(num#(TempDateTime),1/24) AS [DateTimeKey],&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;yields some very strange results, so I am not going to continue investigating this method..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the suggestions though, much appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Jun 2015 13:13:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Timestamp-as-a-Number-How-many-Decimal-Places/m-p/876970#M306251</guid>
      <dc:creator />
      <dc:date>2015-06-01T13:13:50Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamp as a Number - How many Decimal Places?</title>
      <link>https://community.qlik.com/t5/QlikView/Timestamp-as-a-Number-How-many-Decimal-Places/m-p/876971#M306252</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So, as suggested in the cookbook article, wrapping the values in the timestamp#(timestamp())&amp;nbsp; pair of functions seems to work - although it needs to be done on both the Fact table as well as the Calendar...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Jun 2015 13:19:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Timestamp-as-a-Number-How-many-Decimal-Places/m-p/876971#M306252</guid>
      <dc:creator />
      <dc:date>2015-06-01T13:19:58Z</dc:date>
    </item>
  </channel>
</rss>

