Here is my data table:
invoice_id invoice_line store_id time_stamp product units sales cogs
10000001 31215 3 9/3/17 3000 1 99.99 58.00
10000001 31216 3 9/3/17 3354H 3 32.99 18.00
10000002 91455 1 9/5/17 1234 2 24.99 20.00
10000003 59943 2 9/5/17 3000 1 19.99 14.99
10000004 95027 2 9/5/17 18518 1 9.99 3.00
10000005 73994 2 9/5/17 12HA12 15 3.99 1.99
10000006 98464 1 10/1/17 wh30000 1 199.99 75.00
Please know that the table is not organized well.
I need to summarize total sales, total quantity sold, and total profit (which can be calculated as total sales less cogs) by the week number, store id.
How can I do this group by week where week starts on a Tuesday?