I used to have:
Select customer, count(*), now() as time
From product_registry
Group By customer
ORDER BY COUNT(customer) DESC
I currently have:
Select customer, count(*), substring(model_number, 4, 6) as product_model, now() as time
From product_registry
WHERE product_model = ANY(${selected_product_model})
Group By customer
ORDER BY COUNT(customer) DESC
I have setup as a variable in grafana called selected_product_model
but the above code is not working.
I want to filter my ordered customer values where substring(model_number, 4, 6) is equal to any of the selected strings the user chose when clicking through the selected_product_model
options.
Separate from this, I am also unsure how I could display all selected variables in a single grafana table panel. I am new to Grafana and PostgreSQL so I was struggling to find any info on this on youtube/stack overflow/grafana community forums/grafana docs. If anyone could point me towards the code that does that or how I could learn it myself that would be great.