8 Replies Latest reply on Jan 4, 2019 1:08 AM by Selvi velraj

# Selecting a range of hours

Hi

I have a dataset that is made up of of hours of the day 0hr -24hr. Days of the month, 1 June 2017 - 30 June 2017. Names of people and usage of a service in any given hour on any day,. I have filters that show the hour. So you can see that x many used y at 7am across different days. The requirement I need is to show how much was used during any 2 hr, 3hr, 4 hr, 5hr, 6hr, 7hr window and so on. These windows can be across any time of the day. So if the user selects a 3hr window, it will show the usage of the whole day for any 3 hour period. But I am not sure how to do this.

An ideas?

I cant show a workbook as its confidential info

Thanks

• ###### 1. Re: Selecting a range of hours

Hi David,

Just to get a clear picture, When I select 3 hours, I will get a range of 3 hours (e.g. 9AM, 10AM, 11AM) or Just the total for 3 hours or every 3 hours? Your statement "it will show the usage of the whole day for any 3 hour period" is what I need to understand.

Can you do an image of how it would look like. Or create a sample workbook that represents your data and how you want it to appear.

Regards,

• ###### 2. Re: Selecting a range of hours

Hi Peter

Thank you for your response.  So if you select 3 hours, you will get the total usage in all 3 hour periods of the day.  Whether it is 11am-2pm or 3pm_6pm. Similarly if you select 2 hours, it will show the usage across all 2hr periods of the day.

E.g  it will show the total if x was used between 2-4 and y was used between 6-8. But don't need to see the individual periods.

Does that help?

Thanks again Peter

Best Wishes

David

• ###### 3. Re: Selecting a range of hours

You might want to use a bin for this purpose or create a calculated field that calculates a "range".

I used Superstore for this.

Instead of hours, I used Days. I created a calculated field called Days = DAY(Order date)

Since Days would be in Measures, I can create a bin from it.

Within Bins, I created an option for it to be controlled by a parameter that will help determine the size (1 Day, 2 Days, 3 Days, 4 Days)

I dragged the Bins to Column and Sales (this can represent consumption) to rows.

Hope this helps.

• ###### 4. Re: Selecting a range of hours

Thanks Peter. This sounds great. I am just on the way out to a meeting so will check it out later

Thank you!!

Best Wishes

David

• ###### 5. Re: Selecting a range of hours

Thanks Peter. this might do the job!

On 7 August 2017 at 09:42, Peter Timbol <tableaucommunity@tableau.com>

• ###### 6. Re: Selecting a range of hours

Hi David,

Thanks,

• ###### 7. Re: Selecting a range of hours

Hi Peter.

Done. Thanks again!

On 9 August 2017 at 05:43, Peter Timbol <tableaucommunity@tableau.com>

• ###### 8. Re: Selecting a range of hours

Hi

I could not replicate this for Hour range.. Can anyone help