I need some help… I am looking to group all of the family types of wall and then collect all of the area of the wall types and export that to excel. Any one have an easy solution…?

# Help with Group by Key

**astone**#1

0 Likes

**astone**#5

True, that was my first option, however i need to get the data to write to excel takeoff sheet…

0 Likes

**Thomas_Mahon**#6

You could use BimorphNodes package `GetScheduleData`

then simply export the table data to Excel. If your Excel already contains formulae then use @Konrad_K_Sobon Archi-labs Excel exporter (I think the package is called bumblebee) since the Dynamo Excel exporter destroys preexisting formulas (its a known bug)…

0 Likes

**erfajo**#8

You could also write your own ‘Type Summation’

The code in the example has two possible outputs, adjust commenting for the solution you want.

```
import sys
sys.path.append('C:\\Program Files (x86)\\IronPython 2.7\\Lib')
import collections
#The inputs to this node
fam = IN[0]
area = IN[1]
#group the values in a dictionary
elemVal = collections.defaultdict(int)
#sum grouped values
for f, v in zip(fam, area) :
elemVal[f] += v
#Output sorted as types(list0) and sums(list1)
OUT = zip(*elemVal.items())
#Output sorted as types and sums (grouped)
#OUT = elemVal.items()
```

0 Likes

Python Nodes Basics

Pull values from sublist, add new values to sublist

Pull values from sublist, add new values to sublist