Transform Group By

Similar to a groupby but returns a column to original dataset.

Function:

TransformGroupBy(table = string, value = string, cols = list, method = drop down, new_col = string)

 

Parameters:

Table: Table name on which to perform function

Value: Column with Values you wish to evaluate

Columns to Group: Columns that you wish to Group

Method: How to aggregate the data (sum, count, mean, min, max, median)

New Column Name: Name for new grouped table

 

Examples:

TransformGroupBy(table = Budget, value = Amount, cols = [geo, business_unit], method = sum,  new_col = Budget_Grouped)