I am new to Metabase. It is easy to use and very helpful.
But I think if the SQL variable can add a checkbox to add the SQL snippet or not.
What I want to do is allow the dashboard’s user can group by some fields he wants.
For example, we have a table like below:
country, game_name, user
EN, wow, 10000
DE, wow, 999
EN, heartstone, 111
DE, heartstone, 111
I want to let the user to
group by country or
group by game_name
or even group by country and game_name
so, I can define two checkbox named if_country_group and if_game_group. Then I can write the sql like below:
select [[ country {{if_country_group}} , ]] [[ game_name {{if_game_group}} ,]] sum(people)
from table1
group by [[ country {{if_country_group}} , ]] [[ game_name {{if_game_group}} ]]