Separate Departmental Reports

Hello Friends,

I have a setup that has 3 Departments (BAR, GARDEN and KITCHEN)

I have a Sales Report that has actually been giving me the correct report.

[TOTAL SALES:1, 1, 1]

@{REPORT ORDER DETAILS:O.MenuItemName,O.ExactTotal.Sum:(ODI=True):{0}:,}
{REPORT ORDER DETAILS:O.MenuItemName,O.Quantity.Sum,O.ExactTotal.Sum:(ODI=True) and (TY=$1) and O.MenuItemName=“$2”}
{REPORT ORDER DETAILS:’ '+[O.PortionName],O.Quantity.Sum,O.ExactTotal.Sum:(ODI=True) and (TY=$1) and O.MenuItemName=“$2”:2}
>TOTAL|{REPORT ORDER DETAILS:O.ExactTotal.sum}

[ITEM SALES PER SECTIONS:6, 1, 2]
@{REPORT ORDER DETAILS:O.Department.asc:(ODI=True):,}
@{REPORT ORDER DETAILS:O.MenuItemName,O.ExactTotal.Sum.desc:(ODI=True) and (DE=$1):{0}:,}
>>$1
{REPORT ORDER DETAILS:O.MenuItemName,O.Quantity.Sum.desc,O.ExactTotal.Sum:(ODI=True) and (DE=$1) and O.MenuItemName=“$2”}
{REPORT ORDER DETAILS:’ '+[O.PortionName],O.Quantity.Sum,O.ExactTotal.Sum:(ODI=True) and (DE=$1) and O.MenuItemName=“$2”:2}
>>TOTAL{REPORT ORDER DETAILS:MT.productType,O.Quantity.sum,O.ExactTotal.Sum:(ODI=True) and (DE=$1)}

[USER SALES:1, 1]
{REPORT ORDER DETAILS:O.User,O.ExactTotal.Sum.desc}
@{REPORT PAYMENT DETAILS:P.User,P.Amount.Sum::{0}:,}

My client (Business Owner) has asked that he wants 3 separate reports (1 for each of the Departments) as he has separate supervisors for each department that he wants to be analyzing their own departments.

I have tried adding the filter (OD.DepartmentName=BAR) as below but am getting a blank report instead.

Could someone assist me with it…

[TOTAL SALES:1, 1, 1]

@{REPORT ORDER DETAILS:O.MenuItemName,O.ExactTotal.Sum:(ODI=True) and (OD.DepartmentName=BAR):{0}:,}

{REPORT ORDER DETAILS:O.MenuItemName,O.Quantity.Sum,O.ExactTotal.Sum:(ODI=True) and (TY=$1) and (O.MenuItemName=“$2”) and (OD.DepartmentName=BAR)}

{REPORT ORDER DETAILS:’ '+[O.PortionName],O.Quantity.Sum,O.ExactTotal.Sum:(ODI=True) and (TY=$1) and (O.MenuItemName=“$2”) and (OD.DepartmentName=BAR):2}

>TOTAL|{REPORT ORDER DETAILS:O.ExactTotal.Sum:(ODI=True) and (OD.DepartmentName=BAR)}

[ITEM SALES PER SECTIONS:6, 1, 2]

@{REPORT ORDER DETAILS:O.Department.asc:(ODI=True) and (OD.DepartmentName=BAR):,}

@{REPORT ORDER DETAILS:O.MenuItemName,O.ExactTotal.Sum.desc:(ODI=True) and (DE=$1) and (OD.DepartmentName=BAR):{0}:,}

>>$1

{REPORT ORDER DETAILS:O.MenuItemName,O.Quantity.Sum.desc,O.ExactTotal.Sum:(ODI=True) and (DE=$1) and (O.MenuItemName=“$2”) and (OD.DepartmentName=BAR)}

{REPORT ORDER DETAILS:’ '+[O.PortionName],O.Quantity.Sum,O.ExactTotal.Sum:(ODI=True) and (DE=$1) and (O.MenuItemName=“$2”) and (OD.DepartmentName=BAR):2}

>>TOTAL{REPORT ORDER DETAILS:MT.productType,O.Quantity.sum,O.ExactTotal.Sum:(ODI=True) and (DE=$1) and (OD.DepartmentName=BAR)}

[USER SALES:1, 1]

{REPORT ORDER DETAILS:O.User,O.ExactTotal.Sum.desc:(ODI=True) and (OD.DepartmentName=BAR)}

@{REPORT PAYMENT DETAILS:P.User,P.Amount.Sum::{0}:,}

:folded_hands:

Hello @Mambo ,

You can check the below report if it matches your needs;

[Department Sales Totals:3,3, 2, 3, 2]
>Total Sales of|{REPORT ORDER DETAILS:O.Department,O.TotalPrice.Sum:(DE=BAR)}
>Total Sales of|{REPORT ORDER DETAILS:O.Department,O.TotalPrice.Sum:(DE=GARDEN)}
>Total Sales of|{REPORT ORDER DETAILS:O.Department,O.TotalPrice.Sum:(DE=KITCHEN)}
>>Grand Total||{REPORT ORDER DETAILS:O.TotalPrice.Sum}

[BAR Department Sales:1,2,1,1]
>Item Group|Item|[N]Quantity|[C]Total
{REPORT ORDER DETAILS:O.ItemGroup,O.MenuItemName,O.Quantity,O.TotalPrice:(DE=BAR)}
>Total|||{REPORT ORDER DETAILS:O.TotalPrice.Sum:(DE=BAR)}

[GARDEN Department Sales:1,2,1,1]
>Item Group|Item|[N]Quantity|[C]Total
{REPORT ORDER DETAILS:O.ItemGroup,O.MenuItemName,O.Quantity,O.TotalPrice:(DE=GARDEN)}
>Total|||{REPORT ORDER DETAILS:O.TotalPrice.Sum:(DE=GARDEN)}

[KITCHEN Department Sales:1,2,1,1]
>Item Group|Item|[N]Quantity|[C]Total
{REPORT ORDER DETAILS:O.ItemGroup,O.MenuItemName,O.Quantity,O.TotalPrice:(DE=KITCHEN)}
>Total|||{REPORT ORDER DETAILS:O.TotalPrice.Sum:(DE=KITCHEN)}

Hey @Nizam,

Thanks for the report… It works. Only that it gives me items multiple times (per sale). How can I make it cumulative.

It gives this…

But I would love this…

:folded_hands:

Hello @Mambo ,

You can try the below report;

[Department Sales Totals:3,3, 2, 3, 2]
>Total Sales of|{REPORT ORDER DETAILS:O.Department,O.TotalPrice.Sum:(DE=BAR)}
>Total Sales of|{REPORT ORDER DETAILS:O.Department,O.TotalPrice.Sum:(DE=GARDEN)}
>Total Sales of|{REPORT ORDER DETAILS:O.Department,O.TotalPrice.Sum:(DE=KITCHEN)}
>>Grand Total||{REPORT ORDER DETAILS:O.TotalPrice.Sum}

[BAR Department Sales:1,2,1,1]
>Item Group|Item|[N]Quantity|[C]Total
{REPORT ORDER DETAILS:O.ItemGroup,O.MenuItemName,O.Quantity.Sum,O.TotalPrice.Sum:(DE=BAR)}
>Total|||{REPORT ORDER DETAILS:O.TotalPrice.Sum:(DE=BAR)}

[GARDEN Department Sales:1,2,1,1]
>Item Group|Item|[N]Quantity|[C]Total
{REPORT ORDER DETAILS:O.ItemGroup,O.MenuItemName,O.Quantity.Sum,O.TotalPrice.Sum:(DE=GARDEN)}
>Total|||{REPORT ORDER DETAILS:O.TotalPrice.Sum:(DE=GARDEN)}

[KITCHEN Department Sales:1,2,1,1]
>Item Group|Item|[N]Quantity|[C]Total
{REPORT ORDER DETAILS:O.ItemGroup,O.MenuItemName,O.Quantity.Sum,O.TotalPrice.Sum:(DE=KITCHEN)}
>Total|||{REPORT ORDER DETAILS:O.TotalPrice.Sum:(DE=KITCHEN)}

This is perfect… Thank you so so much. I really appreciate :folded_hands: :innocent: