Add (sum) column value with multiple condition

Hi,

I’m struggling with this for a while now.
I’d like to create sumifs with relation and rollup, but I can’t set it up properly.
Here is my table:
image
I’d like to sum the values in “Total P1” with the condition if “Kiválasztott Event” and “EV_P1” match. So for example if Prága and Zoli then 1700.

Hi zoli, You can can create a template column combining Kiválasztott Event and EV_P1. Then you will have a primary key you can rely on. Just create a relation towards that template column and roll it up. You will have a sumifs.

Hi Marc-Olivier,

thanks, I could make it, it looks like this:
image

What else do I need to do to have this information on the layout screen in a simple form. I’ve created a summary page where I’d like to summarize the results but it looks like this:

As I wrote before, you have to create a column combining something like Praga-Zoli (combination of Praga and Zoli) in the same table. You need then to create a self relation to that column and roll it up.

1 Like

An alternative is using the query column.

Yes but I always ask myself why Glide says not to use Query column for this kind of process but it works great too.

I have seen the query column be much slower than a relation column in certain cases, especially when a query needs to run on thousands of rows. But you could also argue that additional split text and/or template columns also add additional overhead before a relation can run.

If at all possible, I will try to avoid involving computed columns on either side of a relation or query because every computed columns needs to process before a relation can process. Next I will evaluate if using extra computed columns along with a relation is any better performance-wise over a query column on its own. Finally, I will 100% use a query column over a relation if there is no reasonable way to achieve the same thing with a relation (ex. date ranges).

For the most part, if I need to match up more than one set of columns, then I will use a query. If I’m only matching up one set of columns, then I use a relation. If using a query affects performance, I will at least try doing the same thing with a relation to see which one is better.

Don’t rule out Query completely. It has it’s uses.

3 Likes

I share this take. Also it makes things easier to evaluate now that you can evaluate how long a column takes to calculate.

image

3 Likes

Me three.

Analyze Performance is documented now:

https://www.glideapps.com/docs/reference/account/performance-analysis

I’ve tried it a couple of times on one of my more complex Apps, but it just melts my web browser :melting_face:

3 Likes