engageLively / galyleo-dashboard

3 stars 2 forks source link

Add aggregation functions and pivots to GalyleoTable #26

Open rickmcgeer opened 3 years ago

rickmcgeer commented 3 years ago

Aggregation functions come up a lot, and are related to pivots. A pivot has pseudo-code that looks like this:

def pivot(self, pivot_column, value_column): new_columns = list(set([r[pivot_column] for r in self.rows])) new_rows = [[0 for i in r[1:] for r in self.rows] for i in len(new_rows): row = self.rows[i] new_rows[i][new_columns[row[pivot_column]]] = row[value_column] return Table(new_rows, newCoumns)

A count takes in a bunch of key_columns, and counts the number of unique entries for each value of the key columns.

Both return new tables.

rickmcgeer commented 2 years ago

Transfer to Jira