Group Data

Evaluate a set of conditions and returns a specific result based on the first condition that is true, think Case Statement

Function:

Groups(table = string, col = string, data_group = {logical_choice = drop down, value = string, then = string}, else_value = string, new_col = string)

 

Parameters:

Table: Table name on which to perform function

Column to Group: Column to evaluate

Data Group: You can have as many groups/evaluations as you need 

  • Logical Selection: Method to evlauate; (equals, greater than, Is before date.... ect)
  • Value: Value to evaluate in the column selected to group (ie. find "USA" in column "Geo")
  • Then: Value to replace the evaluated value with (ie. replace "USA" with "United States")

 

Examples:

Groups(table = Budget, col = "Geo", data_group = {logical_choice = "Equals", value = "USA", then = "United States", logical_choice = "Equals", value = "CA", then = "Canada"}, else_value = "Latan America", new_col = "Geo Cleaned")