# Conditional Rollup within Glide data editor

**URL:** <https://community.glideapps.com/t/conditional-rollup-within-glide-data-editor/9415>\
**Category:** Ask for Help\
**Created:** [May 19, 2020, 9:55am UTC](https://community.glideapps.com/t/conditional-rollup-within-glide-data-editor/9415 "2020-05-19T09:55:01Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lisa](https://avatars.discourse-cdn.com/v4/letter/l/f08c70/32.png) [@Lisa](https://community.glideapps.com/u/Lisa)\
**Post date:** [May 19, 2020, 9:55am UTC](https://community.glideapps.com/t/conditional-rollup-within-glide-data-editor/9415/1 "2020-05-19T09:55:01Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)\
**Post date:** [May 19, 2020, 10:14am UTC](https://community.glideapps.com/t/conditional-rollup-within-glide-data-editor/9415/2 "2020-05-19T10:14:59Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Lisa](https://avatars.discourse-cdn.com/v4/letter/l/f08c70/32.png) [@Lisa](https://community.glideapps.com/u/Lisa)\
**Post date:** [August 5, 2020, 11:03am UTC](https://community.glideapps.com/t/conditional-rollup-within-glide-data-editor/9415/3 "2020-08-05T11:03:58Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)\
**Post date:** [August 5, 2020, 11:52am UTC](https://community.glideapps.com/t/conditional-rollup-within-glide-data-editor/9415/4 "2020-08-05T11:52:02Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Lisa](https://avatars.discourse-cdn.com/v4/letter/l/f08c70/32.png) [@Lisa](https://community.glideapps.com/u/Lisa)\
**Post date:** [August 5, 2020, 12:22pm UTC](https://community.glideapps.com/t/conditional-rollup-within-glide-data-editor/9415/5 "2020-08-05T12:22:33Z")

</div>

Done. Thanks for reminding me of this!

---

<div class="post-metadata">

**Author:** ![HeartwoodTreeCo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/heartwoodtreeco/32/8150_2.png) [@HeartwoodTreeCo](https://community.glideapps.com/u/HeartwoodTreeCo)\
**Post date:** [December 4, 2020, 4:45pm UTC](https://community.glideapps.com/t/conditional-rollup-within-glide-data-editor/9415/6 "2020-12-04T16:45:11Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [December 4, 2020, 4:54pm UTC](https://community.glideapps.com/t/conditional-rollup-within-glide-data-editor/9415/7 "2020-12-04T16:54:46Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![HeartwoodTreeCo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/heartwoodtreeco/32/8150_2.png) [@HeartwoodTreeCo](https://community.glideapps.com/u/HeartwoodTreeCo)\
**Post date:** [December 4, 2020, 11:55pm UTC](https://community.glideapps.com/t/conditional-rollup-within-glide-data-editor/9415/8 "2020-12-04T23:55:12Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![gp9293](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gp9293/32/16743_2.png) [@gp9293](https://community.glideapps.com/u/gp9293)\
**Post date:** [January 28, 2021, 9:44pm UTC](https://community.glideapps.com/t/conditional-rollup-within-glide-data-editor/9415/9 "2021-01-28T21:44:58Z")

</div>

@Robert_Petitto I followed this, almost. I am trying rollup based on user and date. Same concept as with shopping cart. There is a list of dollar amount values and I want to sum by user and by date. Grateful for a few more breadcrumbs. Thank you.

---

<div class="post-metadata">

**Author:** ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)\
**Post date:** [January 28, 2021, 10:00pm UTC](https://community.glideapps.com/t/conditional-rollup-within-glide-data-editor/9415/10 "2021-01-28T22:00:48Z")

</div>

So you want to get a total dollar amount per user per date or just total per date?

---

<div class="post-metadata">

**Author:** ![gp9293](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gp9293/32/16743_2.png) [@gp9293](https://community.glideapps.com/u/gp9293)\
**Post date:** [January 28, 2021, 10:08pm UTC](https://community.glideapps.com/t/conditional-rollup-within-glide-data-editor/9415/11 "2021-01-28T22:08:25Z")

</div>

On second thought, once the app is running, each user will be logged into his/her own account, so the sum only needs to be by date (date is a column). So, each transaction record includes user, date, amount. Thank you.

---

<div class="post-metadata">

**Author:** ![gp9293](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gp9293/32/16743_2.png) [@gp9293](https://community.glideapps.com/u/gp9293)\
**Post date:** [January 28, 2021, 11:35pm UTC](https://community.glideapps.com/t/conditional-rollup-within-glide-data-editor/9415/12 "2021-01-28T23:35:36Z")

</div>

@Robert_Petitto I read a bunch of your other (quite instructive) material and cracked this. Thank you for making me think.

---

<div class="post-metadata">

**Author:** ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)\
**Post date:** [January 29, 2021, 2:02am UTC](https://community.glideapps.com/t/conditional-rollup-within-glide-data-editor/9415/13 "2021-01-29T02:02:44Z")

</div>

Glad I could help! 😁

---

<div class="post-metadata">

**Author:** ![NoCodeAndy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nocodeandy/32/62530_2.png) [@NoCodeAndy](https://community.glideapps.com/u/NoCodeAndy)\
**Post date:** [January 17, 2024, 4:53pm UTC](https://community.glideapps.com/t/conditional-rollup-within-glide-data-editor/9415/14 "2024-01-17T16:53:39Z")

</div>


