How to get the Totals for separated Product Tags

Hello Friends

I Tag my products I sale in 2 groups, “Kitchen” and “Bar”, but can not manage to have a correct Grand Total for each group in my Reports.

I use following syntax 2 custom reports (kitchen and bar):

U can see, they not have the correct “Total”, bcs sums up ALL sale.

BAR:


KITCHEN:

The “Total” of both reports is equal (1.310.000), but I need to sum up ONLY Kitchen and ONLY the Bar…

Whats the code for this query?

Thanks a lot in advance my friends!

try MenuItem.Tag = "food" expression.

you mean instead of “Kitchen” make a report with “food”? But will solve it also my proble of wrong counting for the Bar?
Cheersssss!

I tried, has the same effect, counts all food PLUS all BAR in the grand Total … so I need kind of restriction in TOTAL IF … Kitchen … so sad I can program a little FORTRAN from 100 years ago but SQL or the Report syntax I not mamnage, hic hic

You separated kitchen and bar items by using menu item tag so you can try filtering by menu item tag on grand total line.

If you show us how you changed your report we can also understand what you’ve tried :wink:

uhhh, so sorryyy, THAT was an unfinished answered “sliped away” by some hasty movement, lol :blush:

I tried follow ur previous suggestion, using “food” instead kitchen, but gives me same result total of bar AND food (kitchen), this is the tmeplate I used

this the query result

How about a IFSUM(…Kitchen…) command!? In Excel I use that syntax to filter and sum up values of a specific Tag… does it exist in Samba?? (btw what the name of the report language? SQL/HTML…) and when “yes”, how can I apply it?

Thx again, your Factory47

Can you try one of them as two last lines of bar report?

>Total:||{REPORT ORDER DETAILS:O.ExactTotal.Sum:(MT.Bar=$1)}
>Grand Total:||{REPORT ORDER DETAILS:O.ExactTotal.Sum:MenuItem.Tag = "bar"}

or

>Total:||{REPORT ORDER DETAILS:O.ExactTotal.Sum:(MT.Bar=$1)}
>Grand Total:||{REPORT ORDER DETAILS:O.ExactTotal.Sum:O.ItemTag = "bar"}

The first option gives following result (only sums the last sale )

the second. sums nothing:cry:

comes up with this:

:sweat:

OK so use the first one. I assumed you marked all bar items as bar here.

Marked all bar items? I dont understand the question… :grin:
You mean I should mark them…? and then ??

My very previous idea was to use the FIRST Tag to define each product if is a “food” or “bar” item. To easier filter in future for e.g. the print out to map the print jobs for the bar and kitchen printer, BUT there the Product Tag is NOT recognized ( no Idea why) so I had to map the prints jops each by each product GROUP , but thast OK.

Then I followed the idea on a discussion “Custom Report: Group by product tag” here in the forum (Custom Report: Group by product tag), so I define 2 new Tags, name “Bar” and “Kitchen”, to separate my products in those 2 groups (and sub groups). All works perfect then :heart_eyes:, except the stupid Grand Total…:grin:

 >Grand Total:||{REPORT ORDER DETAILS:O.ExactTotal.Sum:MenuItem.Tag = "bar"}

This line sums items that tagged (I incorrectly said marked sorry) as bar. If you tagged Product A and Product B as bar (on the column I painted in yellow) that sums Product A and Product B.

However some of your items are tagged as lowercase bar and title case Bar. You should tag all Bar items as bar so all tags becomes same for all bar items. Let’s correct this and let me know the result.

2 Likes

Done!!! :heart_eyes: I changed all “Bar” to “bar” in the Produkt Tags and tricked in the template with the uppercase “Bar” I get the product-group sum and with the lowercase “bar” the Grand total :blush:

Now I trick the Kitchen Report the same way with “Kitchen” and “food”, hehe


AWESOME!

Did someone told you already U R a GENIUS!! :yum:

But dont run away, NOW I work on the TABLE Report, hahah

Have a Good Day and kindly greetings from Vietnam to Turkey!

2 Likes