Skip to main content
Solved

Use formulas in an interface number elemtent

  • October 4, 2023
  • 3 replies
  • 539 views

Forum|alt.badge.img+4

I've set up an interface dashboard that pulls in data from two different tables. Within this dashboard are two number elements that are Field summery Sums of data from the two tables. 

In a third Number element I wanted to use a formula to divide one by the other, I thought I could use a very simple formula for this in the element itself, but I cant. 

Is it possible to do what I need in the interface dashboard?

Best answer by Alessio_Monino

Hi @sehenley,

I regret to inform you that it is currently not possible to create a formula directly within the interface that utilizes aggregations from two different tables for calculations. However, in my previous projects, I addressed this limitation by employing a script to incorporate the aggregated values into two separate rows within a custom "Aggregation" table. This approach not only allows for the calculation to be performed directly through the Airtable script but also provides the flexibility to execute highly intricate calculations, leveraging the power of JavaScript.

I hope this helps!

Website: https://alessiomonino.com
Calendly: https://alessiomonino.com/contact
Email: alessio.monino@gmail.com

3 replies

Forum|alt.badge.img+11
  • Participating Frequently
  • 160 replies
  • Answer
  • October 4, 2023

Hi @sehenley,

I regret to inform you that it is currently not possible to create a formula directly within the interface that utilizes aggregations from two different tables for calculations. However, in my previous projects, I addressed this limitation by employing a script to incorporate the aggregated values into two separate rows within a custom "Aggregation" table. This approach not only allows for the calculation to be performed directly through the Airtable script but also provides the flexibility to execute highly intricate calculations, leveraging the power of JavaScript.

I hope this helps!

Website: https://alessiomonino.com
Calendly: https://alessiomonino.com/contact
Email: alessio.monino@gmail.com


Forum|alt.badge.img+3
  • Participating Frequently
  • 13 replies
  • October 5, 2023

simply write the formula in the airtable base and reference it with the number field. If you want to add dynamic conditions to it, you can do so within the number in interfaces. So for example, you have a "Show Expenses" checkbox. Add two conditions to the number in the interface: When "Show Expenses" = checked+conditions, OR "Show Expenses" = not checked+conditions


Forum|alt.badge.img+4
  • Author
  • New Participant
  • 3 replies
  • October 5, 2023

simply write the formula in the airtable base and reference it with the number field. If you want to add dynamic conditions to it, you can do so within the number in interfaces. So for example, you have a "Show Expenses" checkbox. Add two conditions to the number in the interface: When "Show Expenses" = checked+conditions, OR "Show Expenses" = not checked+conditions


Thanks that's really usefull, I actually used a roll up field to do calcuations in the base and reference that in the dashboard