# How to use Context and Reference?

**URL:** <https://community.spicecrm.io/t/how-to-use-context-and-reference/769>\
**Category:** KReporter\
**Created:** [July 9, 2025, 6:34pm UTC](https://community.spicecrm.io/t/how-to-use-context-and-reference/769 "2025-07-09T18:34:10Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rsp](https://avatars.discourse-cdn.com/v4/letter/r/4491bb/32.png) [@rsp](https://community.spicecrm.io/u/rsp)\
**Post date:** [July 9, 2025, 6:34pm UTC](https://community.spicecrm.io/t/how-to-use-context-and-reference/769/1 "2025-07-09T18:34:10Z")

</div>

Hello @maretval,

We want to use the Context and Reference fields in the kreport. But we do not know how to use them.

Our requirement is that we want to display week value equal to zero when we do not have any reporting data. We are using OR in the select clause and then added the new filter under the root.

Please guide us!

---

<div class="post-metadata">

**Author:** ![maretval](https://avatars.discourse-cdn.com/v4/letter/m/b38774/32.png) [@maretval](https://community.spicecrm.io/u/maretval)\
**Post date:** [July 10, 2025, 7:10am UTC](https://community.spicecrm.io/t/how-to-use-context-and-reference/769/2 "2025-07-10T07:10:42Z")

</div>

Context is meant to be used in charts.  
Reference is meant to be used in unions.  
What do want to report on?

---

<div class="post-metadata">

**Author:** ![rsp](https://avatars.discourse-cdn.com/v4/letter/r/4491bb/32.png) [@rsp](https://community.spicecrm.io/u/rsp)\
**Post date:** [August 13, 2025, 3:36pm UTC](https://community.spicecrm.io/t/how-to-use-context-and-reference/769/3 "2025-08-13T15:36:28Z")

</div>

We wanted the OR condition with the same field

---

<div class="post-metadata">

**Author:** ![rsp](https://avatars.discourse-cdn.com/v4/letter/r/4491bb/32.png) [@rsp](https://community.spicecrm.io/u/rsp)\
**Post date:** [August 15, 2025, 5:11pm UTC](https://community.spicecrm.io/t/how-to-use-context-and-reference/769/4 "2025-08-15T17:11:09Z")

</div>

For report, we have the date field, and we want to select from and to in it.

Could we select the two fields from the module and store into the reference and then use them in from & to fields? 🤔 🤔 🤔

---

<div class="post-metadata">

**Author:** ![maretval](https://avatars.discourse-cdn.com/v4/letter/m/b38774/32.png) [@maretval](https://community.spicecrm.io/u/maretval)\
**Post date:** [August 18, 2025, 6:02am UTC](https://community.spicecrm.io/t/how-to-use-context-and-reference/769/5 "2025-08-18T06:02:37Z")

</div>

Then you need a group in the filter tab

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/spicecrm/original/1X/fc94b7723c18d57ef19909f3455df28bfa7606d2.png)

---

<div class="post-metadata">

**Author:** ![maretval](https://avatars.discourse-cdn.com/v4/letter/m/b38774/32.png) [@maretval](https://community.spicecrm.io/u/maretval)\
**Post date:** [August 18, 2025, 6:04am UTC](https://community.spicecrm.io/t/how-to-use-context-and-reference/769/6 "2025-08-18T06:04:04Z")

</div>

A from to filter is achieved by selecting the “is between” operator

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/spicecrm/original/1X/0354eaf4e89b65da02bed5453e694e8e8dfb6f7b.png)
