# Error in report calculation / Hierarchical data in Reports

**URL:** <https://community.fibery.io/t/error-in-report-calculation-hierarchical-data-in-reports/6525>\
**Category:** Get Help\
**Created:** [August 21, 2024, 6:49am UTC](https://community.fibery.io/t/error-in-report-calculation-hierarchical-data-in-reports/6525 "2024-08-21T06:49:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lars](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/lars/32/7322_2.png) [@lars](https://community.fibery.io/u/lars)\
**Post date:** [August 21, 2024, 6:49am UTC](https://community.fibery.io/t/error-in-report-calculation-hierarchical-data-in-reports/6525/1 "2024-08-21T06:49:42Z")

</div>

Hey there.

Given a simple database with a name field and an (integer) number field, why does the following formula throw an error?

![image](https://us1.discourse-cdn.com/flex020/uploads/fibery/original/2X/9/9663abda2c09f24f24f119ab3428fbcf194dc029.png)  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/fibery/original/2X/3/3c75e8745028f383fb060a5cdb3da2fb6ccac068.png)

What am I missing?

On a related note: What other options do I have to display recursively hierarchical data in a report table? (Items with self-relation)

Best,  
Lars

---

<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:** [August 21, 2024, 6:59am UTC](https://community.fibery.io/t/error-in-report-calculation-hierarchical-data-in-reports/6525/2 "2024-08-21T06:59:25Z")

</div>

If `[Number]` is a number field, I’m not sure that you can use `LEFT()` on it

---

<div class="post-metadata">

**Author:** ![Matt\_Blais](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/matt_blais/32/1464_2.png) [@Matt\_Blais](https://community.fibery.io/u/Matt_Blais)\
**Post date:** [August 21, 2024, 5:01pm UTC](https://community.fibery.io/t/error-in-report-calculation-hierarchical-data-in-reports/6525/3 "2024-08-21T17:01:03Z")

</div>

That is odd… I use a similar formula that works 👍 –

```auto
 Left("— — — — — — ", 3 * (Depth - 1)) + Name

```

(`Depth` is a numeric Formula field)

---

<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:** [August 21, 2024, 8:41pm UTC](https://community.fibery.io/t/error-in-report-calculation-hierarchical-data-in-reports/6525/4 "2024-08-21T20:41:54Z")

</div>

> [@Chr1sG](#):
>
> If `[Number]` is a number field, I’m not sure that you can use `LEFT()` on it

I realise now that the formatting on my phone was misrepresenting your formula, and I thought it was `LEFT('[Number]')` 🤦‍♂️

Now I see what you’re doing, and my guess is that `LEFT` requires the second argument to be an integer literal, and won’t work with a variable.  
I’ll double-check with the devs.

Note: report formulas can behave differently to db formula fields
