Has anyone attempted to make a report that lists menu items or group codes sales per hour? Ive made a draft but I am not sure if I like the layout. Any chance you guys have something slightly better that you would like to share? Even a suggestion on how to make it “cleaner” is appreciated.
[Sales:2, 4, 2, 2]
>>Time|Item|Total|%
@{REPORT ORDER DETAILS:O.ItemGroup,O.ExactTotal.sum.desc::{0}:,}
@{REPORT ORDER DETAILS:O.MenuItemName,O.ExactTotal.Sum.desc:(ODI=True):{0}:,}
>>$1
>{REPORT ORDER DETAILS:FT([O.Time],'hh').asc,O.MenuItemName,O.ExactTotal.sum,O.ExactTotal.Percent:(ODI=True) and (MG=$1)}
Until I figure out how to do something like O.Time="$1" … Or maybe use a setting to compare with time?
The best thing I can do is use the default product Tag to mark the items in bulk as Food, Drinks, Alcohol etc.
Then I use a Custom Tag called Category to subdivide them more into different more specific categories.
[Sales:2, 4, 2, 2]
>>Time|Item|Total|%
@{REPORT ORDER DETAILS:M.Tag,O.ExactTotal.sum.desc::{0}:,}
>>$1
>{REPORT ORDER DETAILS:FT([O.Time],'hh').asc,MT.Category,O.ExactTotal.sum,O.ExactTotal.Percent:(ODI=True) AND M.Tag="$1"}
[Sales:2, 4, 2, 2]
>>Time|Item|Total|%
@{REPORT ORDER DETAILS:FT([O.Time],'hh').asc:(ODI=True)}
>$1
{REPORT ORDER DETAILS:MT.Category.asc,O.ExactTotal.sum,O.ExactTotal.Percent:(ODI=True) AND FT([O.Time],'hh')="$1"}
But doublt ‘(ODI=True) AND FT([O.Time],‘hh’)=“$1”}’ will work.
If noting else you could add an order state for ordered hour as state obviously is very easily report-able. Wouldnt backdate but would work going forward.
I found some topic where Q was doing all sort of ingenious stuff and I found this, so I tried to use that almost last bit.
> -- Find customers who have non zero balances
> -- :Fields to reutrn
> -- | :Conditions (select the entity type I want to look for)
> -- | | :Although we are asking for 2 fields, only output the first one (index 0)
> -- | | | :???Not sure what this section is for???
> -- | | | |:Only output the value where the second field is not zero (the second field is the balance, even though it's not output)
> -- | | | || :Use a comma to separate each field (useful because we will use this in another report)
> {REPORT ENTITY DETAILS:E.Id,E.Balance.sum:(ET=Customers):{0}::($2!=0):,}
So I gave it a go and it started giving a lot better outcome but something is still missing…
[Sales:2, 4, 2, 2, 2]
>>Time|Item|Total|%
@{REPORT ORDER DETAILS:FT([O.Time],'hh').asc,O.ExactTotal.sum.desc::{0}:,}
>>$1
{REPORT ORDER DETAILS:MT.Category,O.ExactTotal.sum,O.ExactTotal.Percent:(ODI=True):::FT([O.Time],'hh')="$1":}
There is no way to fix it as far as I remember so I used order states. I would assign {DATE:HH} order state on New Order Added rule and would report it like that. However you cant back date with this so…
[Category per Hour:1, 1, 1, 1]
>>Description|Order Count|Total|%
@{REPORT ORDER DETAILS:OS.TimeStatus.asc:(ODI=True):{0}:,}
>>$1:00
{REPORT ORDER DETAILS:O.ItemGroup,O.Quantity.sum,O.ExactTotal.sum,O.ExactTotal.Percent.desc:(ODI=True) and (OS.TimeStatus=$1)}