3 Replies Latest reply on Aug 1, 2018 11:15 AM by crhoades

# Returning the max Hour Number

Hey guys,

I've got a data set that shows the number of orders across specific days, cities, states, and hour numbers (1-24). I need to return the hour number that has the MOST orders per state. I did exactly what I am looking for in Excel and attached the result below, but would like to know how to do this in Tableau in the same table format. Attached is the Tableau workbook with the specific data loaded into it.

Thank you

• ###### 1. Re: Returning the max Hour Number

you can get  the sum of orders  per State per Hour  with

{FIXED [State], [Hour]:SUM(  [Orders] )}

Then you can create a filter returning true when this number is the MAX  for each State with

{FIXED [State]: MAX([Orders(perStateHour)])} = [Orders(perStateHour)]

Michel

1 of 1 people found this helpful
• ###### 2. Re: Returning the max Hour Number

Hi ,

Kindly check the detailed steps to achieve the result

1) Convert Hours to Dimension like below

2) Drag State and Hours to rows and orders to text

3) Create a calculated field like below

4) Drag the calculation next to hour

5) Edit the table calculation

7) Compute using follow the below screen shot

8) Drag the field to filter and select True

FINAL VIEW;

Hope this detailed explanation helps

Kindly mark this answer as correct/helpful so that it will help others

BR,

NB

• ###### 3. Re: Returning the max Hour Number

Both of these work. Thanks guys!