Dear all,
I need to group a table based on the date and the hourly interval:
- Date
- Interval: from 8am today to <8am today+1
Previously I was using MS Access and a query to create it. Now I need to go through Power Query in MS Excel.
That was the SQL Query used before:
*SELECT switch(Tbl_Prod_Chat.[Interval]>=8,Tbl_Prod_Chat.[Date],Tbl_Prod_Chat.[Interval]<8,Tbl_Prod_Chat.[Date]-1) AS LINK_DATE, Tbl_Prod_Chat.Agent, Sum(Tbl_Prod_Chat.ProdChat) AS Prod_Cha
FROM Tbl_Prod_Chat
GROUP BY Switch(Tbl_Prod_Chat.[Interval]>=8,Tbl_Prod_Chat.[Date],Tbl_Prod_Chat.[Interval]<8,Tbl_Prod_Chat.[Date]-1), Tbl_Prod_Chat.Agent;**
The table is built as:
- Date (type/format: mm/dd/yyyy)
- Interval (type: whole number): 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 0
- Volume of contact (type: whole number)
Can you please help me on this?