Custom Hourly Report

Hi there!

We are running a small cafe which needs an hourly report and I followed this tutorial to create it succesfully

11 PM

I have 2 questions, are we able to edit the contents that are shown in the report? for eg if we want to show the total sales for the hour instead of %Sales, and also are we able to export the report in Excel or CSV format?


Hey John
Well you have all the SQL code you just need to edit the code right?

UPDATE @tbl_Sales SET
 [AvgTx] = (CASE WHEN [Tickets]=0 THEN 0 ELSE [Amount]/[Tickets] END)
,[Percent] = [Amount]/@TotalSales * 100

At a glance (as T-SQL not my thing) but change [Amount]/@TotalSales * 100 -> [Amount] I think gives you total.

Also exporting is done by creating a DATA EXPORT using syntax {REPORT SQL DETAILS:x} . I wanted to offer an example but realized I do not have an export using SQL. I may be corrected if it cannot be used there by other posters.

Cheers Paul.

1 Like

The Report already shows both of those. The Total is column 2 (“SALES” column in your screenshot).

Any Report can be turned into a Data Export, which supports any type of plain-text output such as CSV, XML, etc. You cannot export directly to XLS because that is not plain-text, but Excel can of course read CSV files.