# Report By Specific ItemTag grouped by Department

**URL:** <https://forum.sambapos.com/t/report-by-specific-itemtag-grouped-by-department/12451>\
**Category:** V5 Question\
**Created:** [September 13, 2016, 4:52am UTC](https://forum.sambapos.com/t/report-by-specific-itemtag-grouped-by-department/12451 "2016-09-13T04:52:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vits](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/v/c68b51/32.png) [@vits](https://forum.sambapos.com/u/vits)\
**Post date:** [September 13, 2016, 4:52am UTC](https://forum.sambapos.com/t/report-by-specific-itemtag-grouped-by-department/12451/1 "2016-09-13T04:52:48Z")

</div>

I’d like to do a data export for specific products that I’ve tagged, grouped by department

What I’ve got is:

```
Report
Department;Category;Sales
{REPORT ORDER DETAILS:O.Department,O.ItemTag,O.ExactTotal.Sum,::"{0}";"{1}";"{2}"}
;;=SUM(C3:C<row-1>)

```

That gives me the total as expected, but how would I go about having subtotals for each department?

I was thinking along the lines of:

```
Report
Department;Category;Sales
{REPORT ORDER DETAILS:O.Department:(DE=Restaurant),O.ItemTag,O.ExactTotal.Sum,::"{0}";"{1}";"{2}"}
;;=SUM(C3:C<row-1>)

```

to just show for one department.

Also, how would I filter by specific item tags?

```
 {REPORT ORDER DETAILS:O.ItemTag:(??=Beverages)
```

---

<div class="post-metadata">

**Author:** ![pauln](https://forum.sambapos.com/user_avatar/forum.sambapos.com/pauln/32/12698_2.png) [@pauln](https://forum.sambapos.com/u/pauln)\
**Post date:** [September 13, 2016, 8:43am UTC](https://forum.sambapos.com/t/report-by-specific-itemtag-grouped-by-department/12451/2 "2016-09-13T08:43:23Z")

</div>

> [@vits](#):
>
> That gives me the total as expected, but how would I go about having subtotals for each department

Hey vits

One method is to feed the departments used into a @Parameter List and then pipe them into the {REPORT ORDER DETAILS:x} tag:

```
@{REPORT TICKET DETAILS:T.Department,T.TotalAmount.sum::{0}:,}
>Dept: $1
{REPORT ORDER DETAILS:O.User,O.ExactTotal.Sum:(DE=$1):{0}|${1}:}

```

That above is user sales per department.

I have not used tags much so no help there.
