# Building weighting formulas across databases and Lookup

**URL:** <https://community.fibery.io/t/building-weighting-formulas-across-databases-and-lookup/4613>\
**Category:** Get Help\
**Created:** [June 12, 2023, 10:49pm UTC](https://community.fibery.io/t/building-weighting-formulas-across-databases-and-lookup/4613 "2023-06-12T22:49:01Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mother\_Bones](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/mother_bones/32/6927_2.png) [@Mother\_Bones](https://community.fibery.io/u/Mother_Bones)\
**Post date:** [June 12, 2023, 10:49pm UTC](https://community.fibery.io/t/building-weighting-formulas-across-databases-and-lookup/4613/1 "2023-06-12T22:49:01Z")

</div>

UPDATE: I got “[Angle Goals].Sum(Priority)” to show values on the Angles database! Yay!

Basically I’m trying to score things in many databases and then run those scores through a formula to then generate a list of “next priority” ideas (maybe in a Doc that can then get made into tasks). My problem is I can’t reliably Lookup or use Formulas to reference the fields in other datasets.

In plain English I have multiple datasets in which each item gets a numerical score and a weighted score - we’ll call them Goals, Blocks, Platforms, Frames, Angles, Slants, and Periods. Each will have a base priority and a weighted priority based on its relationships. That weighted priority is what then gets passed on to the final priority calculation.

Here’s the exact problem I’ve run into already:

I have Goals (many to many) related to Frames and Angles. Frames are one to many Angles. I can Lookup the Frames scores from Angles, but nothing else. I’ve tried using a formula and calling it through the relation, but I can’t figure out for the life of me how to make it work. The Formulas documentation has not been serving me terribly well.

Goals.Sum(Priority) says it’s not declared no matter where I try to put it (Frames, Angles, or trying to get scores out of those two into Goals). Nevermind that isn’t the actual formula I want to use, I just want to test access to the fields lol

The actual formula I want to use is more future proof. Basically I want to convert a plain English priority (1 for first, 2 for second) into a number never larger than 1 - a percent multiplier for weighting a value later on.

And, uhm, I have yet to make such a formula work… so if you could help with that too heh 🙂

Essentially what I’m thinking for the formula is something like this:

Absolute Value of (Priority - (Total Goals Count + 1)) / Total Goals Count

Like in Angles I’m working on this:

Absolute Value of ([Angle Goals].Sum(Priority) - Total Goals Count Squared) / Total Goals Count

UPDATE 2: Are [these](https://reports-help.fibery.io/calculations/overview_numerical) ONLY for reports? Or some such? I tried using Absolute Value and Running Sum in a formula and it said they didn’t exist.

Why can I not find a comprehensive list of functions for formulas when I’m looking for functions for formulas??

---

<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:** [June 13, 2023, 8:42am UTC](https://community.fibery.io/t/building-weighting-formulas-across-databases-and-lookup/4613/2 "2023-06-13T08:42:28Z")

</div>

> [@Mother\_Bones](#):
>
> Are [these](https://reports-help.fibery.io/calculations/overview_numerical) ONLY for reports?

Yes

> [@Mother\_Bones](#):
>
> Why can I not find a comprehensive list of functions for formulas when I’m looking for functions for formulas??

The formula field reference guide is here:  
[https://the.fibery.io/@public/User\_Guide/Guide/Formulas-reference-44](https://the.fibery.io/@public/User_Guide/Guide/Formulas-reference-44)

> [@Mother\_Bones](#):
>
> UPDATE: I got “[Angle Goals].Sum(Priority)” to show values on the Angles database! Yay!
> 
> …
> 
> Essentially what I’m thinking for the formula is something like this:
> 
> Absolute Value of (Priority - (Total Goals Count + 1)) / Total Goals Count

As you have discovered, it is possible to write formulas that calculate aggregate values for related items.  
However, any given entity in a database, does not ‘know’ anything about the values of items it is not-related to.

So even if an entity in database A is linked to multiple entities in database B (i.e. A1 → B1, B2) it is not aware of _all_ entities in database B.  
There is no possible formula field that will allow A1 to calculate` (B1.value + B2.value)/(B1.value + B2.value + B3.value)`

Similarly, no entity in database B is aware of other entities in the same database.

It is possible to do such calculations in a report, but report views are read-only summaries.

---

<div class="post-metadata">

**Author:** ![Mother\_Bones](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/mother_bones/32/6927_2.png) [@Mother\_Bones](https://community.fibery.io/u/Mother_Bones)\
**Post date:** [June 13, 2023, 9:36pm UTC](https://community.fibery.io/t/building-weighting-formulas-across-databases-and-lookup/4613/3 "2023-06-13T21:36:22Z")

</div>

> [@Chr1sG](#):
>
> [. | Fibery](https://the.fibery.io/@public/User_Guide/Guide/Formulas-reference-44)

.First and .Last and some other similar “sub” functions are not really well explained. And I’ve never found a use for the [This Entity] thing but it’s interesting.

I’ve managed to get formulas to work both ways and since Absolute Value calculations can’t be done in formulas, I found the Formulas guide for Single-Select and that made me super happy - now I can just give it a calculable value then seek Max / Greatest to calculate max then make the percentile weight 🙂

Took long enough but I’m starting to get the hang of this language…

---

<div class="post-metadata">

**Author:** ![Mother\_Bones](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/mother_bones/32/6927_2.png) [@Mother\_Bones](https://community.fibery.io/u/Mother_Bones)\
**Post date:** [June 13, 2023, 10:12pm UTC](https://community.fibery.io/t/building-weighting-formulas-across-databases-and-lookup/4613/4 "2023-06-13T22:12:21Z")

</div>

HAHA!

Ok so yeah every last formula is going to use info specifically from what is attached… oki doki… let’s see if I can add another hidden value…

---

<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:** [June 13, 2023, 10:13pm UTC](https://community.fibery.io/t/building-weighting-formulas-across-databases-and-lookup/4613/5 "2023-06-13T22:13:54Z")

</div>

> [@Mother\_Bones](#):
>
> I’ve never found a use for the [This Entity] thing but it’s interesting.

You might wanna read [this](https://community.fibery.io/t/done-ability-to-access-current-entity-in-non-automation-formula/2681).

---

<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:** [June 13, 2023, 10:15pm UTC](https://community.fibery.io/t/building-weighting-formulas-across-databases-and-lookup/4613/6 "2023-06-13T22:15:52Z")

</div>

> [@Mother\_Bones](#):
>
> Absolute Value calculations can’t be done in formulas

Do you mean Abs(x) ?  
It can be achieved using `if(x<0,0-x,x)`

---

<div class="post-metadata">

**Author:** ![carson](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/carson/32/7503_2.png) [@carson](https://community.fibery.io/u/carson)\
**Post date:** [November 29, 2023, 9:04pm UTC](https://community.fibery.io/t/building-weighting-formulas-across-databases-and-lookup/4613/7 "2023-11-29T21:04:44Z")

</div>

🤦‍♂️ That’s much better than Power(.5, Power(2)) like I was assuming I’d have to do…

---

<div class="post-metadata">

**Author:** ![Polina\_Zenevich](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/polina_zenevich/32/480_2.png) [@Polina\_Zenevich](https://community.fibery.io/u/Polina_Zenevich)\
**Post date:** [January 16, 2025, 8:10pm UTC](https://community.fibery.io/t/building-weighting-formulas-across-databases-and-lookup/4613/8 "2025-01-16T20:10:45Z")

</div>

Well, it took some time, but syntax was released today 🙂

> [@January 16, 2025 / microscope Very experimental My Items vs. All Items in sidebar, some emails and formulas improvements](https://community.fibery.io/t/january-16-2025-very-experimental-my-items-vs-all-items-in-sidebar-some-emails-and-formulas-improvements/8141):
>
> Today’s release is very modest, with just few updates here and there and one very experimental feature. ring Very experimental: Left Sidebar My Items vs. All Items We’re working on the new sidebar and in this release we’re releasing very experimental changes. Main idea is to introduce My Items area where all important things lives, so you can work mainly in this mode and enjoy more clear left sidebar. My Items is like a whitelist of things you care about. What changed: Favorites renamed to…

---

<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:** [January 16, 2025, 8:52pm UTC](https://community.fibery.io/t/building-weighting-formulas-across-databases-and-lookup/4613/9 "2025-01-16T20:52:27Z")

</div>


