How to create a screen with a dynamic group by by the end user?

Hi everyone!

I’m trying to build a screen where users can view raw data and select their own dimensions (Group by) for a report on the client side. However, the current table grouping isn’t working quite right, so I’m looking for a clever workaround.

The goal is to pull raw data from the database with both dimensions and metrics, and allow users to pick the dimensions and see the data properly.

For example, some of the dimensions could be:

•	Date
•	Country
•	Analyst
•	Device

And metrics like:

•	Spend
•	Revenue
•	ROAS (Revenue/Spend)

Ideally, users should be able to create a table with dimensions like Date > Country, or just Date, and the metrics should calculate properly. Sorting and filtering by both dimensions and metrics should work as well.

Any ideas or suggestions on how to make this happen? Would love to hear your thoughts!

Thanks in advance! :slight_smile:

Hi @R_S_I_F,

Could you share more about how the current table grouping isn't working?

You can access the existing table grouping api by calling a setGrouping event on any component. It would work similarly to some of the other built-in grouping options. In the example below, I have a checkbox group that exposes 3 possible columns to group by, and the user can select one or multiple options: