Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
I have found how to bring up analytics of sales by hour but it shows each hour of every day rather than all sales made from 1:00 pm to 2:00 pm regardless of date. seems that shopify also groups hour with the date so it is very difficult to extract the data I'm looking for.
Thanks in advance for any help.
I exported my Orders, and then viewed it on Google Sheets. I added these two formulas:
# The day of the week, as a number from 1-7
=WEEKDAY(DATEVALUE(left(D2, len(D2)-5)))
#With lookup table to translate numbers to Mon, Tues, etc.
=vlookup(WEEKDAY(DATEVALUE(left(D2, len(D2)-5))),$C$130:$D$136, 2, True)
# The hour of the day
=right(left(D2,13),2)
This is what the spreadsheet looks like:
You can then take that and make a pivot table, using those two columns for columns + rows, and the data as sum or average of the sales data:
Thanks! This is exactly what we're looking for but could use a little more clarification on the formulas.
Here's expanded comments on the day of the week:
# The day of the week, as a number from 1-7
# Trims the timezone off the end, and then converts it into a date value for Sheets, and then extracts the weekday from the calendar.
# The output is a number from 1-7.
=WEEKDAY(DATEVALUE(left(D2, len(D2)-5)))
# With lookup table to translate numbers to Mon, Tues, etc.
# Make a little table that has the numbers 1-7 in one column, and the days of the week in the second. Change $C$130:$D$136 to reference that little table.
# The output is now the day of the week.
=vlookup(WEEKDAY(DATEVALUE(left(D2, len(D2)-5))),$C$130:$D$136, 2, True)
# The hour of the day
# This trims down the strings to just the two characters for the 24-hour the sale took place in.
=right(left(D2,13),2)
Both of these would probably be easier to read if it was doing substring parsing, instead of chopping up a string. I don't remember why I didn't do that originally.
Discover how to increase customer engagement on your store with articles from Shopify A...
By Jacqui Apr 23, 2025Hey Community 👋 Did you know that March 15th is National Everything You Think Is W...
By JasonH Apr 1, 2025Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025