Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
rsark
Contributor III
Contributor III

How To create a calculated dimension using timestamp intervals

Hello,

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

dimension result example: 6:00 AM - 6:30 AM, 6:31 - 7:00 AM, 7:01 - 7:30, etc

14 Replies
johnw
Champion III
Champion III


Michael Solomovich wrote:John, you're right.
I didn't pay attention that it's about intervals. Tongue Tied


Ah, well. I was hoping I was missing something really brilliant, since I think my solution was pretty clucky. Big Smile

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP


John Witherspoon wrote:
Here's a slightly simpler expression that seems to do the same thing:
=dual(time(floor(timestamp, 1/48),'h:mm TT') & ' - ' &
time(ceil (timestamp, 1/48),'h:mm TT')
,floor(frac(timestamp),1/48))<div></div>


John,

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.

=aggr(dual(time(floor(timestamp, 1/"Interval Size"),'h:mm TT') & ' - ' &
time(ceil (timestamp, 1/"Interval Size"),'h:mm TT')
,floor(frac(timestamp),1/"Interval Size")),
timestamp)


An example is attached. Thanks for the idea!

-Rob

peter_turner
Partner - Specialist
Partner - Specialist

Hello,

I found this thread very interesting and have had a look at the examples from Rob and John.
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'.

Does anyone have any hints to get me started?

Thanks,
Peter.

Not applicable

Hi, As i m using the personal edition , not able to open your provided file. getting error that its only for licenced user.

please help.

Regards

Ravindra Mandre

Not applicable

Hello John , your file can be used only with licenced version of qlikview , i am using personal edition .

please help me on this.

Ravindra Mandre