If you have a really specific query that requires lots of transformation you can use all of the Grow data transformation functions together.
The order needs to be:
- Grouping and Filtering
- Master SQL
First use the SQL to select portions of the data, then you can use Slice and Dice tools to create different groupings and aggregation, and finally you can use Master SQL to pull in specific data points across all the different reports and data sources.