<?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 How To create a calculated dimension using timestamp intervals in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-To-create-a-calculated-dimension-using-timestamp-intervals/m-p/203059#M1208362</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;*smacks forehead* Ah, of course. I forgot about the date portion of the timestamp. We can eliminate it with frac(timestamp). Again, not sure this is the best way, but it seems to work. See attached.&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;=dual(timestamp(class(frac(timestamp) ,30/(24*60)),'h:mm TT') &amp;amp; ' - ' &amp;amp;&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;timestamp(class(frac(timestamp)+30/(24*60),30/(24*60)),'h:mm TT')&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;, class(frac(timestamp) ,30/(24*60)))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 13 May 2009 03:20:17 GMT</pubDate>
    <dc:creator>johnw</dc:creator>
    <dc:date>2009-05-13T03:20:17Z</dc:date>
    <item>
      <title>How To create a calculated dimension using timestamp intervals</title>
      <link>https://community.qlik.com/t5/QlikView/How-To-create-a-calculated-dimension-using-timestamp-intervals/m-p/203054#M1208356</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am attempting to create a bar chart with a calculated dimension that shows 30 minute increments using a timestamp field. I attempting to use the class function - class(minute(timestamp), 30) and I am not having any luck. Any help/suggestions would greatly be appreciated. Thanks&lt;/P&gt;&lt;P&gt;dimension result example: 6:00 AM - 6:30 AM, 6:31 - 7:00 AM, 7:01 - 7:30, etc&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2009 00:39:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-To-create-a-calculated-dimension-using-timestamp-intervals/m-p/203054#M1208356</guid>
      <dc:creator>rsark</dc:creator>
      <dc:date>2009-05-13T00:39:30Z</dc:date>
    </item>
    <item>
      <title>How To create a calculated dimension using timestamp intervals</title>
      <link>https://community.qlik.com/t5/QlikView/How-To-create-a-calculated-dimension-using-timestamp-intervals/m-p/203055#M1208357</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin:0in 0in 0pt;"&gt;First problem is that the minute() function returns an integer between 0 and 59. So your classification just gives you the first half of each hour vs. the second half of each hour.&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;It would be a simple matter to extract the number of minutes from the start of the day, timestamp*24*60, so you could do class(timestamp*24*60,30). You then have the right groups, but they'll display poorly, such as 960 &amp;lt;= x &amp;lt; 990.&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;You could instead stick with timestamps, like class(timestamp, 30/(24*60), but that looks even worse, as it shows the fraction of the day, not a timestamp format.&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;You can do a timestamp format, like timestamp(class(timestamp,30/(24*60)),'h:mm TT'), but then it only shows the starting time, not the ending time. Still, maybe that's good enough.&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;To get exactly what you're asking for, though, it looks like this does the trick:&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;=dual(timestamp(class(timestamp ,30/(24*60)),'h:mm TT') &amp;amp; ' - ' &amp;amp;&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;timestamp(class(timestamp+30/(24*60),30/(24*60)),'h:mm TT')&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;, class(timestamp ,30/(24*60)))&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;There might be a simpler way, but that's what I came up with.&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;You might be better off, though, calculating that in the script rather than at run time in a chart.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2009 01:28:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-To-create-a-calculated-dimension-using-timestamp-intervals/m-p/203055#M1208357</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2009-05-13T01:28:54Z</dc:date>
    </item>
    <item>
      <title>How To create a calculated dimension using timestamp intervals</title>
      <link>https://community.qlik.com/t5/QlikView/How-To-create-a-calculated-dimension-using-timestamp-intervals/m-p/203056#M1208358</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Speaking of simpler way... If you have Date field in you application, you can use&lt;BR /&gt;=Date/48&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2009 01:32:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-To-create-a-calculated-dimension-using-timestamp-intervals/m-p/203056#M1208358</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-05-13T01:32:08Z</dc:date>
    </item>
    <item>
      <title>How To create a calculated dimension using timestamp intervals</title>
      <link>https://community.qlik.com/t5/QlikView/How-To-create-a-calculated-dimension-using-timestamp-intervals/m-p/203057#M1208359</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Put as simply as possible, since when does a date tell you what time it is?&lt;/P&gt;&lt;P&gt;Dividing a date by 48 turns 48 days into a single day, with each day being half an hour. That... makes no sense, and has nothing to do with solving this problem, unless I'm VERY confused.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2009 02:11:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-To-create-a-calculated-dimension-using-timestamp-intervals/m-p/203057#M1208359</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2009-05-13T02:11:35Z</dc:date>
    </item>
    <item>
      <title>How To create a calculated dimension using timestamp intervals</title>
      <link>https://community.qlik.com/t5/QlikView/How-To-create-a-calculated-dimension-using-timestamp-intervals/m-p/203058#M1208360</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi John,&lt;/P&gt;&lt;P&gt;Thanks for the quick reply. I found the expression you provided was very close to what I need, but it seems to be giving a result for each row. I would like to see the result with only 48 possible rows. Thanks in advance for your assistance/reply&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2009 03:05:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-To-create-a-calculated-dimension-using-timestamp-intervals/m-p/203058#M1208360</guid>
      <dc:creator>rsark</dc:creator>
      <dc:date>2009-05-13T03:05:52Z</dc:date>
    </item>
    <item>
      <title>How To create a calculated dimension using timestamp intervals</title>
      <link>https://community.qlik.com/t5/QlikView/How-To-create-a-calculated-dimension-using-timestamp-intervals/m-p/203059#M1208362</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;*smacks forehead* Ah, of course. I forgot about the date portion of the timestamp. We can eliminate it with frac(timestamp). Again, not sure this is the best way, but it seems to work. See attached.&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;=dual(timestamp(class(frac(timestamp) ,30/(24*60)),'h:mm TT') &amp;amp; ' - ' &amp;amp;&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;timestamp(class(frac(timestamp)+30/(24*60),30/(24*60)),'h:mm TT')&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;, class(frac(timestamp) ,30/(24*60)))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2009 03:20:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-To-create-a-calculated-dimension-using-timestamp-intervals/m-p/203059#M1208362</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2009-05-13T03:20:17Z</dc:date>
    </item>
    <item>
      <title>How To create a calculated dimension using timestamp intervals</title>
      <link>https://community.qlik.com/t5/QlikView/How-To-create-a-calculated-dimension-using-timestamp-intervals/m-p/203060#M1208364</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;The solution John provided worked. I added the expression in resident table load and linked back to timestamp field. &lt;IMG alt="Smile" src="http://community.qlik.com/emoticons/emotion-1.gif" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2009 03:27:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-To-create-a-calculated-dimension-using-timestamp-intervals/m-p/203060#M1208364</guid>
      <dc:creator>rsark</dc:creator>
      <dc:date>2009-05-13T03:27:46Z</dc:date>
    </item>
    <item>
      <title>How To create a calculated dimension using timestamp intervals</title>
      <link>https://community.qlik.com/t5/QlikView/How-To-create-a-calculated-dimension-using-timestamp-intervals/m-p/203061#M1208366</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;The solution John provided worked. I added the expression in resident table load and linked back to timestamp field. &lt;IMG alt="Smile" src="http://community.qlik.com/emoticons/emotion-1.gif" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2009 03:27:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-To-create-a-calculated-dimension-using-timestamp-intervals/m-p/203061#M1208366</guid>
      <dc:creator>rsark</dc:creator>
      <dc:date>2009-05-13T03:27:54Z</dc:date>
    </item>
    <item>
      <title>How To create a calculated dimension using timestamp intervals</title>
      <link>https://community.qlik.com/t5/QlikView/How-To-create-a-calculated-dimension-using-timestamp-intervals/m-p/203062#M1208367</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;John, you're right.&lt;BR /&gt;I didn't pay attention that it's about &lt;STRONG&gt;intervals&lt;/STRONG&gt;. &lt;IMG alt="Tongue Tied" src="http://community.qlik.com/emoticons/emotion-7.gif" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2009 03:32:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-To-create-a-calculated-dimension-using-timestamp-intervals/m-p/203062#M1208367</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-05-13T03:32:20Z</dc:date>
    </item>
    <item>
      <title>How To create a calculated dimension using timestamp intervals</title>
      <link>https://community.qlik.com/t5/QlikView/How-To-create-a-calculated-dimension-using-timestamp-intervals/m-p/203063#M1208368</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's a slightly simpler expression that seems to do the same thing:&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;=dual(time(floor(timestamp, 1/48),'h:mm TT') &amp;amp; ' - ' &amp;amp;&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;time(ceil (timestamp, 1/48),'h:mm TT')&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,floor(frac(timestamp),1/48))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2009 03:34:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-To-create-a-calculated-dimension-using-timestamp-intervals/m-p/203063#M1208368</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2009-05-13T03:34:31Z</dc:date>
    </item>
    <item>
      <title>How To create a calculated dimension using timestamp intervals</title>
      <link>https://community.qlik.com/t5/QlikView/How-To-create-a-calculated-dimension-using-timestamp-intervals/m-p/203064#M1208369</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="jive_text_macro jive_macro_quote" jivemacro="quote"&gt;&lt;BR /&gt;Michael Solomovich wrote:John, you're right.&lt;BR /&gt;I didn't pay attention that it's about &lt;STRONG&gt;intervals&lt;/STRONG&gt;. &lt;IMG alt="Tongue Tied" src="http://community.qlik.com/emoticons/emotion-7.gif" /&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Ah, well. I was hoping I was missing something really brilliant, since I think my solution was pretty clucky. &lt;IMG alt="Big Smile" src="http://community.qlik.com/emoticons/emotion-2.gif" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2009 03:42:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-To-create-a-calculated-dimension-using-timestamp-intervals/m-p/203064#M1208369</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2009-05-13T03:42:44Z</dc:date>
    </item>
    <item>
      <title>How To create a calculated dimension using timestamp intervals</title>
      <link>https://community.qlik.com/t5/QlikView/How-To-create-a-calculated-dimension-using-timestamp-intervals/m-p/203065#M1208370</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="jive_text_macro jive_macro_quote" jivemacro="quote"&gt;&lt;BR /&gt;John Witherspoon wrote:&lt;BR /&gt;Here's a slightly simpler expression that seems to do the same thing:&lt;BR /&gt;=dual(time(floor(timestamp, 1/48),'h:mm TT') &amp;amp; ' - ' &amp;amp;&lt;BR /&gt; time(ceil (timestamp, 1/48),'h:mm TT')&lt;BR /&gt; ,floor(frac(timestamp),1/48))&amp;lt;div&amp;gt;&amp;lt;/div&amp;gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;John,&lt;/P&gt;&lt;P&gt;That's a very elegant expression. It solves a problem for me where I want to let the user choose an interval without having to precalulate the intervals. I extended your idea to use a field selection where the user selects an interval. Even finer control could be given by using a variable. Also creates some interesting possibilities for flexible drill down groups.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;=aggr(dual(time(floor(timestamp, 1/"Interval Size"),'h:mm TT') &amp;amp; ' - ' &amp;amp;&lt;BR /&gt; time(ceil (timestamp, 1/"Interval Size"),'h:mm TT')&lt;BR /&gt; ,floor(frac(timestamp),1/"Interval Size")),&lt;BR /&gt; timestamp)&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;An example is attached. Thanks for the idea!&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2009 13:07:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-To-create-a-calculated-dimension-using-timestamp-intervals/m-p/203065#M1208370</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2009-05-13T13:07:03Z</dc:date>
    </item>
    <item>
      <title>How To create a calculated dimension using timestamp intervals</title>
      <link>https://community.qlik.com/t5/QlikView/How-To-create-a-calculated-dimension-using-timestamp-intervals/m-p/203066#M1208371</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;I found this thread very interesting and have had a look at the examples from Rob and John.&lt;BR /&gt;I've extended the interval down to 10min blocks, but would also like to increase the interval size to include 7,14 and 30 day 'blocks'.&lt;BR /&gt;&lt;BR /&gt;Does anyone have any hints to get me started?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Peter.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Apr 2010 16:04:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-To-create-a-calculated-dimension-using-timestamp-intervals/m-p/203066#M1208371</guid>
      <dc:creator>peter_turner</dc:creator>
      <dc:date>2010-04-19T16:04:29Z</dc:date>
    </item>
    <item>
      <title>How To create a calculated dimension using timestamp intervals</title>
      <link>https://community.qlik.com/t5/QlikView/How-To-create-a-calculated-dimension-using-timestamp-intervals/m-p/203067#M1208372</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, As i m using the personal edition , not able to open your provided file. getting error that its only for licenced user. &lt;/P&gt;&lt;P&gt;please help. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Ravindra Mandre&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Dec 2011 05:09:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-To-create-a-calculated-dimension-using-timestamp-intervals/m-p/203067#M1208372</guid>
      <dc:creator />
      <dc:date>2011-12-09T05:09:11Z</dc:date>
    </item>
    <item>
      <title>Re: How To create a calculated dimension using timestamp intervals</title>
      <link>https://community.qlik.com/t5/QlikView/How-To-create-a-calculated-dimension-using-timestamp-intervals/m-p/203068#M1208373</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;﻿Hello John , your file can be used only with licenced version of qlikview , i am using personal edition . &lt;/P&gt;&lt;P&gt;please help me on this. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ravindra Mandre&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Dec 2011 06:00:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-To-create-a-calculated-dimension-using-timestamp-intervals/m-p/203068#M1208373</guid>
      <dc:creator />
      <dc:date>2011-12-09T06:00:54Z</dc:date>
    </item>
  </channel>
</rss>

