Possible silly question but I was hoping you could help, I'm trying to build an interactive chart where based on what is checked in the checkbox group values are summed and then referenced by the chart.
case
when {{checkboxGroup1.selectedIndexes[0,1,2] = true}} then sum(gmv_across_verticals)
when {{checkboxGroup1.selectedIndexes[0,1] = true}} then (coalesce(sum(gmv_activities),0) + coalesce(sum(bb_gmv_confirmed),0))
when {{checkboxGroup1.selectedIndexes[0,2] = true}} then (coalesce(sum(nursery_gmv),0) + coalesce(sum(bb_gmv_confirmed),0))
when {{checkboxGroup1.selectedIndexes[0] = true }} then (sum(bb_gmv_confirmed))
when {{checkboxGroup1.selectedIndexes[1] = true}} then (sum(gmv_activities))
when {{checkboxGroup1.selectedIndexes[2] = true }} then (sum(nursery_gmv))
when {{checkboxGroup1.selectedIndexes[1,2] = true }} then (coalesce(sum(gmv_activities),0) + coalesce(sum(nursery_gmv),0))
else 0
end
It may be a very silly way of going about it but this is what I thought could work, the problem is that the query runs but it is un-affected by the selection in the checkbox group, any help would be appreciated!
I think you might have more success adding all of the possibilities as different fields in the output, and then directing your chart to use the appropriate one based on the checkbox values. That way, you run the SQL once and just move through the results in your chart bars on the checkboxes.