Hey everyone,
I’m trying to figure out the most efficient way to get the data I need, using dynamo. I’m guessing Python is the way to go and have some ideas on that (multiple nested for loops), but kinda stuck with how to do it without taking forever to process. Basically I have a list with 2 sublists. In each sublist, if the item number and task number are the same between rows, merge the rows and add quantity together.
So for example…
Item Task Rev Job # Qty Site
34333 2755 A 3-17017 10 Warehouse
37555 2765 A 3-17017 20 Warehouse
37555 2755 A 3-17017 15 Warehouse
37555 2755 A 3-17017 15 Warehouse
34333 2755 A 3-17017 25 Warehouse
34333 2755 A 3-17017 100 Warehouse
Would become…
Item Task Rev Job # Qty Site
34333 2755 A 3-17017 135 Warehouse
37555 2765 A 3-17017 20 Warehouse
37555 2755 A 3-17017 30 Warehouse
(The only column that would change during the merge is Quantity gets added together)
This is a very simplified example, as my live data is 18 columns and 10k+ rows. (hence the concern on how long it will take)
I was thinking I’d get all the unique item numbers and unique task numbers into their own lists, then use for loops against the main list to determine if there is a match. Then write all columns to a new line, adding the quantity. Tried to attach my .dyn that I’m using to test a solution, but it won’t allow me since I’m relatively new here. Any advice is greatly appreciated.
Thank you!
Amber