# Create report specific to User and Department

**URL:** <https://forum.sambapos.com/t/create-report-specific-to-user-and-department/18695>\
**Category:** V5 Question\
**Created:** [November 6, 2018, 1:29pm UTC](https://forum.sambapos.com/t/create-report-specific-to-user-and-department/18695 "2018-11-06T13:29:40Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![JTRTech](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jtrtech/32/21270_2.png) [@JTRTech](https://forum.sambapos.com/u/JTRTech)\
**Post date:** [November 12, 2018, 2:24pm UTC](https://forum.sambapos.com/t/create-report-specific-to-user-and-department/18695/21 "2018-11-12T14:24:30Z")

</div>

Because you done have the user constraint;

> [@JTRTech](#):
>
> So then reporting orders using constraint similar to user payment report ‘(PU=$1)’ to constrain to each.

---

<div class="post-metadata">

**Author:** ![adam100](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/a/f4b2a3/32.png) [@adam100](https://forum.sambapos.com/u/adam100)\
**Post date:** [November 12, 2018, 2:30pm UTC](https://forum.sambapos.com/t/create-report-specific-to-user-and-department/18695/22 "2018-11-12T14:30:45Z")

</div>

> [@JTRTech](#):
>
> Because you done have the user constraint;
> 
> ![](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jtrtech/40/21270_1.png) JTRTech:
> 
> > So then reporting orders using constraint similar to user payment report ‘(PU=$1)’ to constrain to each.

So would I put that at the end of each line or should it be OU since its orders?

---

<div class="post-metadata">

**Author:** ![JTRTech](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jtrtech/32/21270_2.png) [@JTRTech](https://forum.sambapos.com/u/JTRTech)\
**Post date:** [November 12, 2018, 2:38pm UTC](https://forum.sambapos.com/t/create-report-specific-to-user-and-department/18695/23 "2018-11-12T14:38:20Z")

</div>

It would be OU.  
it would be an and after ODI constraint.

---

<div class="post-metadata">

**Author:** ![Jesse](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jesse/32/61493_2.png) [@Jesse](https://forum.sambapos.com/u/Jesse)\
**Post date:** [November 12, 2018, 2:58pm UTC](https://forum.sambapos.com/t/create-report-specific-to-user-and-department/18695/24 "2018-11-12T14:58:56Z")

</div>

(O.User=$1) add that.

---

<div class="post-metadata">

**Author:** ![adam100](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/a/f4b2a3/32.png) [@adam100](https://forum.sambapos.com/u/adam100)\
**Post date:** [November 12, 2018, 3:03pm UTC](https://forum.sambapos.com/t/create-report-specific-to-user-and-department/18695/25 "2018-11-12T15:03:04Z")

</div>

> [@Jesse](#):
>
> (O.User=$1) add that.

Ok Here is what I have then

```
@{REPORT ORDER DETAILS:O.User,O.ExactTotal.Sum::{0}:,}
[Sales by $1:1, 1, 1]
>{REPORT ORDER DETAILS:O.MenuItemName,O.Quantity.Sum.desc,O.ExactTotal.Sum.desc:(ODI=True)(O.User=$1}
{REPORT ORDER DETAILS:' '+[O.PortionName],O.Quantity.Sum.desc,O.ExactTotal.Sum.desc:(ODI=True):2(O.User=$1}}

```

![Sales%20Report4](https://forum.sambapos.com/uploads/default/original/3X/1/e/1ec8be7f55c5514259ff81a0858ad98f8847d636.png)

---

<div class="post-metadata">

**Author:** ![Jesse](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jesse/32/61493_2.png) [@Jesse](https://forum.sambapos.com/u/Jesse)\
**Post date:** [November 12, 2018, 3:17pm UTC](https://forum.sambapos.com/t/create-report-specific-to-user-and-department/18695/26 "2018-11-12T15:17:44Z")

</div>

Get rid of exact total from parameter at top

---

<div class="post-metadata">

**Author:** ![JTRTech](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jtrtech/32/21270_2.png) [@JTRTech](https://forum.sambapos.com/u/JTRTech)\
**Post date:** [November 12, 2018, 3:22pm UTC](https://forum.sambapos.com/t/create-report-specific-to-user-and-department/18695/27 "2018-11-12T15:22:20Z")

</div>

It’s not that, it’s the portion line, really be needs two @ declarations, one list of users and a list of menu items in order for the menu item by portion style report to work.  
@adam100 it it were me I’d drop the portion part and add portion as a column, makes report allot simpler.

---

<div class="post-metadata">

**Author:** ![adam100](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/a/f4b2a3/32.png) [@adam100](https://forum.sambapos.com/u/adam100)\
**Post date:** [November 12, 2018, 3:26pm UTC](https://forum.sambapos.com/t/create-report-specific-to-user-and-department/18695/28 "2018-11-12T15:26:05Z")

</div>

Actually I’m going to just remove the portion altogether. Since this is in a retail type store, its mostly scanned items anyway.

---

<div class="post-metadata">

**Author:** ![JTRTech](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jtrtech/32/21270_2.png) [@JTRTech](https://forum.sambapos.com/u/JTRTech)\
**Post date:** [November 12, 2018, 3:31pm UTC](https://forum.sambapos.com/t/create-report-specific-to-user-and-department/18695/29 "2018-11-12T15:31:00Z")

</div>

If you dont use portions then drip the \> on first rders report line and remove the seccond one with the ’ '+{O.Portionname] bit.

---

<div class="post-metadata">

**Author:** ![JTRTech](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jtrtech/32/21270_2.png) [@JTRTech](https://forum.sambapos.com/u/JTRTech)\
**Post date:** [November 12, 2018, 3:31pm UTC](https://forum.sambapos.com/t/create-report-specific-to-user-and-department/18695/30 "2018-11-12T15:31:59Z")

</div>

Also your constraints are still wrong…  
it should be (ODI=True) and (O.User=$1)  
Your (O.User=$1) is in the wrong place.

---

<div class="post-metadata">

**Author:** ![adam100](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/a/f4b2a3/32.png) [@adam100](https://forum.sambapos.com/u/adam100)\
**Post date:** [November 12, 2018, 3:41pm UTC](https://forum.sambapos.com/t/create-report-specific-to-user-and-department/18695/31 "2018-11-12T15:41:17Z")

</div>

Ok, I changed the constraint and removed portions. Its back to listing the users with no sales.

```
@{REPORT ORDER DETAILS:O.User,O.ExactTotal.Sum::{0}:,}
[Sales by $1:1, 1, 1]
&gt;{REPORT ORDER DETAILS:O.MenuItemName,O.Quantity.Sum.desc,O.ExactTotal.Sum.desc: (ODI=True) and (O.User=$1)}
{REPORT ORDER DETAILS:O.Quantity.Sum.desc,O.ExactTotal.Sum.desc: (ODI=True) and (O.User=$1)}

```

I am hoping once I get this figured out, that I will be able to easily implement it into a Tobacco Sales report I successfully generated. I can’t for the life of me, figure out what I am doing wrong here.

---

<div class="post-metadata">

**Author:** ![Jesse](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jesse/32/61493_2.png) [@Jesse](https://forum.sambapos.com/u/Jesse)\
**Post date:** [November 12, 2018, 3:46pm UTC](https://forum.sambapos.com/t/create-report-specific-to-user-and-department/18695/32 "2018-11-12T15:46:24Z")

</div>

Ok sorry I told you wrong… you made me look it up lol.

Try this:

```auto
@{REPORT ORDER DETAILS:O.User::{0}:,}
[Sales by $1:1, 1, 1]
{REPORT ORDER DETAILS:O.MenuItemName,O.Quantity.Sum.desc,O.ExactTotal.Sum.desc:(ODI=True) and (TU=$1)}

```

It was TU=$1 not O.User=$1

When in doubt visit here:

[https://kb.sambapos.com/en/cat/reports/](https://kb.sambapos.com/en/cat/reports/)

---

<div class="post-metadata">

**Author:** ![adam100](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/a/f4b2a3/32.png) [@adam100](https://forum.sambapos.com/u/adam100)\
**Post date:** [November 12, 2018, 3:50pm UTC](https://forum.sambapos.com/t/create-report-specific-to-user-and-department/18695/33 "2018-11-12T15:50:27Z")

</div>

That did it! Going to try and plug this into my Tobacco Report now and hopefully it will work out.

---

<div class="post-metadata">

**Author:** ![JTRTech](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jtrtech/32/21270_2.png) [@JTRTech](https://forum.sambapos.com/u/JTRTech)\
**Post date:** [November 12, 2018, 4:00pm UTC](https://forum.sambapos.com/t/create-report-specific-to-user-and-department/18695/34 "2018-11-12T16:00:05Z")

</div>

That will be the user that started the ticket.  
Order user is (OU=$1) based on the default work period report. Although if its retail you wont be running table tabs so there would only be one user per ticket/order on that ticket.

---

<div class="post-metadata">

**Author:** ![adam100](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/a/f4b2a3/32.png) [@adam100](https://forum.sambapos.com/u/adam100)\
**Post date:** [November 12, 2018, 4:13pm UTC](https://forum.sambapos.com/t/create-report-specific-to-user-and-department/18695/35 "2018-11-12T16:13:20Z")

</div>

I think I have it figured out now. My Tobacco report also work perfectly. Here is what I did:

```
@{REPORT ORDER DETAILS:O.User::{0}:,}
[Tobacco Sales for $1:3, 1, 1]
{REPORT ORDER DETAILS:O.MenuItemName,O.Quantity.Sum.desc,O.ExactTotal.Sum.desc:(ODI=True) and (TU=$1) and (MG=Tobacco)}

```

![Tobacco%20Report](https://forum.sambapos.com/uploads/default/original/3X/9/a/9ad2f827320c6075a261e91672e5053e250f16fe.png)

---

<div class="post-metadata">

**Author:** ![adam100](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/a/f4b2a3/32.png) [@adam100](https://forum.sambapos.com/u/adam100)\
**Post date:** [November 12, 2018, 4:14pm UTC](https://forum.sambapos.com/t/create-report-specific-to-user-and-department/18695/36 "2018-11-12T16:14:56Z")

</div>

> [@Jesse](#):
>
> When in doubt visit here:
> 
> [https://kb.sambapos.com/en/cat/reports/](https://kb.sambapos.com/en/cat/reports/)

I Love this and used it to build a few other reports, I didn’t see the section on defining reports by user, however.

---

<div class="post-metadata">

**Author:** ![Jesse](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jesse/32/61493_2.png) [@Jesse](https://forum.sambapos.com/u/Jesse)\
**Post date:** [November 12, 2018, 4:19pm UTC](https://forum.sambapos.com/t/create-report-specific-to-user-and-department/18695/37 "2018-11-12T16:19:33Z")

</div>

There won’t be. It’s a feature called report parameters. It shows how to use the feature.

---

<div class="post-metadata">

**Author:** ![adam100](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/a/f4b2a3/32.png) [@adam100](https://forum.sambapos.com/u/adam100)\
**Post date:** [November 14, 2018, 5:53pm UTC](https://forum.sambapos.com/t/create-report-specific-to-user-and-department/18695/38 "2018-11-14T17:53:46Z")

</div>

Quick question, Is there a way to get this report to also include Tax collected by each user? I tried a few different things, with no luck, I want to drop tax in the workperiod report under Settled By each user.

```
@{REPORT PAYMENT DETAILS:P.User,P.Amount.Sum::{0}:,} 
[Settled by $1:1, 1, 1, 1] 
{REPORT PAYMENT DETAILS:P.Name,P.Amount.Percent,P.Amount.Sum:(PU=$1)} 
>Total Income|{REPORT PAYMENT DETAILS:P.Amount.Sum:(PU=$1)}

```

 ![Sales%20Tax](https://forum.sambapos.com/uploads/default/original/3X/f/a/fa74203e5671b0f5146d69a28e21547957c551c1.png)

So that the accounting office sees the tax collected individually by each user. I tried a few different things and 1 made Samba lock up completely.

---

<div class="post-metadata">

**Author:** ![Jesse](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jesse/32/61493_2.png) [@Jesse](https://forum.sambapos.com/u/Jesse)\
**Post date:** [November 14, 2018, 6:07pm UTC](https://forum.sambapos.com/t/create-report-specific-to-user-and-department/18695/39 "2018-11-14T18:07:31Z")

</div>

If you only have 1 user per ticket you can. But if you use multiple users on each ticket then no you cant. You need to use REPORT TICKET DETAILS tag. Look under reports section of [kb.sambapos.com](http://kb.sambapos.com)

---

<div class="post-metadata">

**Author:** ![adam100](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/a/f4b2a3/32.png) [@adam100](https://forum.sambapos.com/u/adam100)\
**Post date:** [November 15, 2018, 6:38am UTC](https://forum.sambapos.com/t/create-report-specific-to-user-and-department/18695/40 "2018-11-15T06:38:36Z")

</div>

Ok, So I tried this syntax and it works, kind of. I decided to go with listing tax by terminal instead. It shows every transaction taken with sales tax on the corresponding terminal. How would I get this to total that up. `{REPORT TICKET DETAILS:T.Tax:(TE=Till1)}`

I found some help here, by the way.  
[https://sambapos.com/wiki/doku.php/custom\_reporting\_tags](https://sambapos.com/wiki/doku.php/custom_reporting_tags)

[Previous page](https://forum.sambapos.com/t/create-report-specific-to-user-and-department/18695.md?page=1)

[Next page](https://forum.sambapos.com/t/create-report-specific-to-user-and-department/18695.md?page=3)
