How to make Report top 20 item sales

How to make report to top 20 or x quantity of best item sales on 1 month

The default item sales report is ordered descending by quantity/values?
Just change the date range to the dates required…

how to show just 20 item or make limit show

Hmmm interesting question, sure there is a stupid simple solution but can’t think how.
@Jesse your pretty hot on report tags, any ideas?

Well probably the coolest and most intuitive method for this would be an Entity Screen with Custom Report widget and parameters to filter the report to. For example you could have input boxes to input date range, a box to enter top x number items etc. The report will filter to that input and update the report widget to show the desired results.

One minute and I will give a link for you to study

Bah sorry the discussion was in Beta forum. I will copy and paste some of it here.

Crude quick example but here it is.

Here is how I did it.

Sorry dont have time for a big long explanation I am throwing this together I have about 10 minutes.

The rest is Entity Screen with 2 editor widgets one for Begin Date one for EndDate I have 2 label widgets so I can see input. The editor widgets are updating the local settings you see in the Date Filter section of the action. I think the action should be self explanatory for you. The report widget needs to be named obviously and so do the label widgets.

This might show you more ideas on how to use parameters.

Sorry kendash, how does that limit the report to only show top 20?
Have I missed something?

It doesnt, but it should give an idea of how to create that. I dont have a specific example because nobody has created one yet. The discussions here show how it might be built. For starters he would want to select a date range… He certainly would need to use parameters to filter by.

1 Like

fyi… While trying to implement a SQL solution I noticed I didn’t added {Start} {End} tags for date filtering at {REPORT SQL DETAILS}. That will work fine on next (.60) update.

[Top 5 Orders:1, 1]
>Item Name|Total
   SELECT Top 5 MenuItemName,Sum(Price*Quantity) as Amount FROM ORDERS
   Where CreatedDateTime > '{Start}' and CreatedDateTime < '{End}'
   Group by MenuItemName
   Order by Amount desc: