# How to use fields from references in reports?

**URL:** <https://community.fibery.io/t/how-to-use-fields-from-references-in-reports/3905>\
**Category:** Get Help\
**Created:** [February 2, 2023, 9:02am UTC](https://community.fibery.io/t/how-to-use-fields-from-references-in-reports/3905 "2023-02-02T09:02:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![David](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/david/32/6149_2.png) [@David](https://community.fibery.io/u/David)\
**Post date:** [February 2, 2023, 9:02am UTC](https://community.fibery.io/t/how-to-use-fields-from-references-in-reports/3905/1 "2023-02-02T09:02:48Z")

</div>

Hi

I have three databases ‘SaleItems’, ‘Sales’ and ‘Products’. A Sale has a date and can have many SaleItems and a SaleItem consists of a quantity and a reference to a product.

Now, for example I want to create a report with all products sold in 2022 and the amount of sales for each.

I started a report with SaleItems and thought I could filter by [SaleItem].[Sale].[Date] and group by [SaleItem].[Product].[Name]. But I seem to be unable to do it like that, the only way I can get it working is by first creating a new field in SaleItems that looks up [Sale].[Date] and [Product].[Name] and then only use SaleItem in the report.

Is this how I am supposed to do it or is there a better way? It seems it should not be necessary to “pollute” the SaleItem database with all the fields from references that I may possible need in any of my reports just for a simple join?

Thanks!

---

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [February 2, 2023, 10:32am UTC](https://community.fibery.io/t/how-to-use-fields-from-references-in-reports/3905/2 "2023-02-02T10:32:55Z")

</div>

Adding the [Sale].[Date] lookup is probably necessary, but not the [Product].[Name]  
This should already be accessible in a report view based on SaleItems

---

<div class="post-metadata">

**Author:** ![David](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/david/32/6149_2.png) [@David](https://community.fibery.io/u/David)\
**Post date:** [February 2, 2023, 10:54am UTC](https://community.fibery.io/t/how-to-use-fields-from-references-in-reports/3905/3 "2023-02-02T10:54:29Z")

</div>

Thanks for confirming this is the correct way.

I understand why Name should not be needed, it was a bad example, in practice I will need another lookup from the Product table (a SKU).

---

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [February 2, 2023, 11:56am UTC](https://community.fibery.io/t/how-to-use-fields-from-references-in-reports/3905/4 "2023-02-02T11:56:11Z")

</div>

> [@David](#):
>
> It seems it should not be necessary to “pollute” the SaleItem database with all the fields from references

Don’t forget that on entity view you can hide fields you don’t really need to see/use 🙂
