Jun 21, 2019 11:34 AM
I’d be so grateful for any advice on how to clean up a rollup that returns this:
1 shirt(s), 1 pant(s), 1 set of socks, 2 shirt(s)
To this instead:
3 shirt(s), 1 pant(s), 1 set of socks
Basically, my question is how to merge and add like items from a list generated by a rollup.
(In case it helps, the list needs to be dynamic - not one list for the entire base if that makes sense. Each item is associated with a packing list, and then packing lists are added to trips. I want to be able to create one packing list for each trip that does not repeat items when there are multiple packing lists per trip.)
Thank you!!
Jun 21, 2019 08:33 PM
Welcome to the community, Emily! :grinning_face_with_big_eyes: You didn’t describe your base setup, but my hunch is that you’re rolling up all of these items into the record for the trip on a [Trips]
table. Because the trip is pulling from several packing lists, and each packing list has its own count of shirts (for example), that’s the reason for the duplication of shirt entries.
Unfortunately Airtable records effectively have no knowledge of each other. There are limited ways around that, but they won’t work for all scenarios. Long story short, without some cross-record knowledge it’s impossible to know how many similar items may exist across several packing lists.
That said, there may still be a way to get what you want, but the solution will largely depend on the structure of your base. Could you share some more details (screenshots would be a huge help) of the tables you’ve made, and the relevant fields in each?
Jun 22, 2019 05:47 PM
Thank you for your help, Justin! I really appreciate it!
Here are screen shots of the base. My goal is to get one final packing list where like items are merged and added. (E.g., instead of listing shorts twice for the Bar Harbor trip, it would simply say “3 pairs of shorts”) As you mentioned, it sounds like I’ll have to change the structure of my base? Or maybe there is some fancy formula that would convert the “Final Packing List for Each Trip” rollup? I’m open to anything!
Any advice?
Jun 22, 2019 11:50 PM
Hi @Emily_Magid - Rather than show the list of items against the Trips table, I think you want to get the trip name onto the items table, which you should be able to do using a lookup against the packing lists field (my simplified version below):
Now I can create an additional view on this table for, say, Bar Harbour. I can filter where trip = Bar Harbour and group by item. You end up with this:
Hope this helps!
JB
Jun 23, 2019 01:45 AM
Thanks for sharing your base breakdown. After seeing what you’ve got, my suggestion is to build your final packing list from the [Packing Items]
table. That’s where you have everything coming together for each item. Using the links made on the [Itemized Packing Lists]
table, you can add a rollup field pointing to the {Amount}
field, using SUM(values)
to aggregate them. To go a step further, you can actually write a full formula in the aggregation function area, so you don’t just have a number. (I put the {Descriptor}
as part of the [Packing Items]
table, as it felt more appropriate there, which is why it’s in this formula)
Jun 23, 2019 05:58 PM
Hi Justin,
Thank you so much for working on this and helping me. It is so helpful and I appreciate it so much! This is amazing!! My only question is - when I do this, it seems to roll up every single packing list in the entire base, rather than only including the items on the specific packing lists needed for each individual trip? Is that right or am I missing something? Is there a way to limit what is rolled up so that it only includes the subset of itemized packing list items needed (the subset associated with the specific packing lists needed for a trip)?
Thank you so much again!
Jun 23, 2019 06:05 PM
Hi Jonathan,
Look at that! Amazing! Thank you so much. I really appreciate your help!
Could I just ask a few quick follow up questions:
Many thanks again!!
Jun 24, 2019 06:52 PM
That’s right, and admittedly that’s a detail that I overlooked when making that suggestion. My apologies.
…maybe? I haven’t explored your setup much, but the way you’re breaking it down in such detail actually makes re-combining certain data elements more complex. I’ll try to give this some more thought, but it may be tricky to do around other work I’m committed to address.
Jun 25, 2019 12:07 AM
Hi @Emily_Magid - on your follow-up questions:
Then, in the grouped view, group by this field, rather than the item field:
JB
Jun 25, 2019 06:54 PM
Hi Jonathan,
This is so helpful! Thank you so much!! I really appreciate your help!