1 Reply Latest reply on Nov 18, 2016 10:26 AM by Joe Oppelt

# Tableau Discrete 15 minute interval X Axis for DateTime Dimension

Hey Everyone,

I've been searching online for a while now to try and figure this out - there are a lot of similar responses even in the Tableau community - but not producing what I'm looking for.

I need to show a Discrete X-Axis in 15 minute intervals specifically from 8:00AM - 7:00 PM (So points on the axis for 8:00 AM - 8:15 AM/8:15-8:30 AM/etc etc) - I've found community responses using :

DATETIME((INT((FLOAT([DateTime]) -INT(FLOAT([DateTime]))) * [Bins Per Day]) / [Bins Per Day]) +
INT(FLOAT([DateTime])))

OR

Str(DATEPART('hour',DATETIME([start_time (copy 2)]))) + ':' +

Str(If DATEPART('minute',DATETIME([start_time (copy 2)]))>=0

and (DATEPART('minute',DATETIME([start_time (copy 2)]))<30 ) then '00' else '30' End) +

(If DATEPART('hour',DATETIME([start_time (copy 2)]))<12 then ' AM' Else ' PM' End)

While both of these formula's work for creating 15 minute interval bins- Tableau will not recognize either of them as a Date Field - therefore they cannot be used in simple Line graphs showing linear trends over time. Is there any simple way of producing those 15 minute intervals I'm looking for that can be used on a line graph (I know I can bring both "HOUR" and "MINUTE" dateparts onto the axis drop drill-down action, but cannot from there group the minutes into 15 minute bins (with the hour part still being shown)?

• ###### 1. Re: Tableau Discrete 15 minute interval X Axis for DateTime Dimension

Build a calc field that forces all time portions into specific 15-minute intervals.  (Either round the minute portion to the nearest 15 value, or round back to the prior 15 value, for example.)  If the examples you are looking at result in a string value, just wrap the whole thing in the DATETIME() function to convert it to a date-time format.