1 2 3 Previous Next 35 Replies Latest reply on Apr 19, 2018 12:47 PM by Dan Dan

# Create 15 minutes time interval

Hello All,

I need to create15-minute intervals specifically from 500 hrs - 2400 hrs (500-515, 515-530 and so on). I am able to have an hour time interval but could not figure out to how to create it for 15 minutes. Please advise. Here is the calculated field for an hour time interval.

STR(INT(LEFT([Negtime],2))) + " to " + STR(INT(LEFT([Negtime],2))+1)

Thanks

• ###### 1. Re: Create 15 minutes time interval

Need to see entire picture first.

Could you attach original data as packaged workbook or excel, text file whatever. (packaged workbook is the best in any case though)

Thanks,

Shin

• ###### 2. Re: Create 15 minutes time interval

Hello Shin,

As you have asked, I am attaching a data sample with a worksheet. Please let me know if you have any other questions.   Thanks

• ###### 3. Re: Create 15 minutes time interval

Try this one.

[15 min group]

str(int(((float([Negtime])*24)%1)*4)*15)+" to "+str(int(((float([Negtime])*24)%1)*4)*15+15)

Thanks,.

Shin

• ###### 4. Re: Create 15 minutes time interval

Hello Shin,

The calculation just gives me the following output:

But I am looking like

515-530

530-545

545-600

and so on. Thanks

Gurpreet

• ###### 5. Re: Create 15 minutes time interval

and here is a calc that has worked for me...

DATETIME(INT(FLOAT([Timestamp]) * (96 / 1)) / (96 / 1))

• ###### 6. Re: Create 15 minutes time interval

Hello Jeff,

No luck, it does not work for me. While using this, I am getting Date and Time field that shows the following:

Thanks

• ###### 7. Re: Create 15 minutes time interval

can you attach the workbook? here's what I get when I switch mine to year.

• ###### 8. Re: Create 15 minutes time interval

Hello Jeff,

Workbook attached herewith for your kind consideration. Thank you Jeff.

• ###### 9. Re: Create 15 minutes time interval

can you open this?  I created it using 10.1 which is what I have on my computer.  And it shows 15 minute intervals.

• ###### 10. Re: Create 15 minutes time interval

Here you go.

[15 min group]

right(str(100+int((float([Negtime])%1)*24)),2)+

right(str(100+int(((float([Negtime])*24)%1)*4)*15),2)+" to "+

right(str(100+int((float([Negtime])%1)*24)),2)+

right(str(100+int(((float([Negtime])*24)%1)*4)*15+14),2)

Thanks,

Shin

• ###### 11. Re: Create 15 minutes time interval

Sorry Jeff, I cannot open it. I have 10.0 Tableau Version. Thanks

Gurpreet

• ###### 12. Re: Create 15 minutes time interval

Hello Shin,

I am getting an error in the formula. Please see screenshot below:

• ###### 13. Re: Create 15 minutes time interval

I think Shin is on the right path, so work with he provided.

Shin, thanks for using the formula I provided.  I think I got it passed down to me from one of the previous TC's.

• ###### 14. Re: Create 15 minutes time interval

Found some error and deleted previous one, sorry for the confusion..

I am posting again. Try this one and let me know if you have issue.

Jeff, one finding is your method create "X >  6:45 and X =< 7:00" to 7:00

I think we need the formula which shows "X >=  6:45 and X < 7:00" to 6:45

I modified the formula of yours, this should work, but if you have time, please verify my intent.

[15 minutes interval time]

DATETIME(INT((FLOAT([Negtime])-(14.999/60/24)) * (96 / 1)) / (96 / 1))

[15 minutes interval time original]

DATETIME(INT((FLOAT([Negtime])) * (96 / 1)) / (96 / 1))

[15 minutes interval]

right(str(100+datepart('hour',DATETIME(INT(FLOAT([15 minutes interval time]) * (96 / 1)) / (96 / 1)))),2)

+

right(str(100+datepart('minute',DATETIME(INT(FLOAT([15 minutes interval time]) * (96 / 1)) / (96 / 1)))),2)

+ " to " +

right(str(100+datepart('hour',DATETIME(INT(FLOAT(dateadd('minute',15,[15 minutes interval time])) * (96 / 1)) / (96 / 1)))),2)

+

right(str(100+datepart('minute',DATETIME(INT(FLOAT(dateadd('minute',15,[15 minutes interval time])) * (96 / 1)) / (96 / 1)))),2)

Thanks,

Shin

1 of 1 people found this helpful
1 2 3 Previous Next