1

I have some fake account information that I am trying to learn Tableau on and need to be able to filter the date field (which is a timestamp mm/dd/yyyy hh:mm:ss) by 15 minutes. There are around 1,000 records on any given day. I have two ways that could potentially work but don't know how to execute them.

Ask #1: Within those records I want to be able to throw a filter by that date but instead of a 'slide bar' is there a way to show the filter in a drop down format? I know that if I add the date field to the 'PAGE' space it gives me the drop down I want but when changing the dates in the page drop down, the data doesn't change, hence not filtering.

  • Side question: What is the difference between the page and filter spaces in tableau UI?

Ask #2: Within these records, is there way to add another field/column that buckets these dates (timestamps) by 15 min? Picture idea link below. Thank you in advance!

Tableau Sample Example

AlexF116
  • 15
  • 3
  • Look at the functions date_part() and date_trunc() as models. Sounds like you need to write a calc that behaves similarly. As one step, you could use date_part() to extract the # of seconds, and then use the div() function to truncate to a multiple of 15, — then multiply by 15 to yield 0, 15, 30 or 45. – Alex Blakemore Aug 16 '22 at 04:16
  • Did you try the formula in my answer? – Nicolaesse Nov 14 '22 at 13:34

1 Answers1

0

I would do it by creating a calculated field interval with the following formula for classification

IF DATEPART('minute',[Timestamp])>=0
AND DATEPART('minute',[Timestamp])<15
THEN '0-15'
ELSEIF DATEPART('minute',[Timestamp])>=15
AND DATEPART('minute',[Timestamp])<30
THEN '15-30'
ELSEIF DATEPART('minute',[Timestamp])>=30
AND DATEPART('minute',[Timestamp])<45
THEN '30-45'
ELSEIF DATEPART('minute',[Timestamp])>=45
THEN '45-00'
ELSE NULL
END

calculated field example

and then use it to filter rows.

By the way, the pages shelf lets you break a view into a series of pages, I think that in your specific case you should use the filter pane and not the pages pane.

Nicolaesse
  • 2,554
  • 12
  • 46
  • 71