Average() with filter using Rollup in linked table


#1

If I would be dealing with a regular database I would write a query:
SELECT average(field1)
FROM A
WHERE user = “user123”
AND field2= “valueabc”

I can create a “view” with filter and group to get the average shown. But when
I use the API to access that view I get all the records in that view but not the “average(field1)”

When I use the rollup feature with a linked table I can get the average of all the records for that given user but I can’t limit it further by the “field2=valueabc” clause.

Is there a solution to this?


#2

Go to the table your Rollup is pointing to, create a formula field ({Filter}) whith the formula IF(AND({User}="user123",field2="valueabc"),{whatever field you're trying to rollup},""). Then rollup the formula field instead