I would like to determine an average in a table and use that number to calculate in another table. I don’t know how to do that.
Background:
User table with salaries.
I would like to determine an average salary for current employees only, who are in a particular department (so I have to add conditions).
In a second table I would like to calculate the cost for these type employees times the number of employees I forecast in the future.
Questions/Solution
Do I need a rollup, a pipe or an equation? Or do I need make.com to do that? Do I need an automation to do this calculation daily?
Is the average stored in the user table, the forecast table or should there be a table in between?
@Sara thanks but that would mean rebuilding my app. I have department as a “select”, not as a separate table. What can you advice? Should I rebuild this to what you advice, or is there an alternative?
Based on the limited information it sounds like you will have to rebuild your app and have departments as a parent to the employees/salaries. Then add a rollup filed as described previously.
I have my hopes for the sql-editor that seems to be developed in 2023. It should not be too difficult to construct a query to determine an avg in a table with some conditions added.