I want to group by "category" "subcategory" and "monthly" sales value.
sub_total_df = df.groupBy("category", "subcategory", "monthly").agg(sum("sales_value").alias("sub_total"))
You could always type in your query in the Databricks notebook, by clicking on the generate link in cell, which will help you with Databricks Assistant.