Conditional Rollup within Glide data editor

Wondering if anyone has successfully used the rollup column in the data editor meeting certain conditions?

I know this can be done with some spreadsheet magic, but would love to minimize as many google sheets formulas as possible.

Specifically, I’m creating a cart, and would like to sum up the price for cart items only for the specified user.

Yep. Create the relation first, then Rollup the relation.

1 Like

@Robert_Petitto

Let me expand and let me know if I’m missing something.

I want to create a rollup to count the sum of a quantity of items from a relation column ONLY IF a certain condition is met in an adjacent column.

For my use case, I’m matching inventory (cart items) and I only want to count inventory of the items whose orders are marked as paid. I’m indicating whether or not an order is paid with a boolean.

I have a rollup now on the total quantity of the item the user adds to their cart, but it counts all orders, which could be cancelled or not yet paid for by the user.

For the “if paid” boolean, instead of resulting in true/false, result in item name/blank. Then do the multiple relation to the if-then column and then the rollup should be accurate.

1 Like

Done. Thanks for reminding me of this!

1 Like

I have a variation on conditional rollups and I’ve read some of the related posts but I’m still stumped.

It’s for machine maintenance tracking.
One-many relationship between machines and maintenance log
Every log record has a date, but only some have a meter reading

I need to know the most recent meter reading (log has meter is true) and the date of that log record. I was using rollups of maximum meter reading and latest date, but realized that was incorrect. I need the actual date of the maximum meter reading.

Would love to hear from anyone about this!

In your log sheet create an if then column and fill it with true if the log has a meter reading greater than zero. Then create a template that joins the machine ID and the if then value. In your machine sheet, create a template of machine ID and the word ‘true’. Now change your relation to use those templates to link machine to log. Your rollup should then show the max date of a log that has a meter reading.

3 Likes

Thanks, Jeff! That works like it should. I’ve read your answers many times, but this is the first time I’ve been the one asking the question. I really appreciate the way your brain works and how much you share on this forum.

3 Likes