I’ve a measurement in which I’m aggregating the records grouped by a tag. Instead of a sum, I want to find the percentage out of the total. My query to find aggregate is:
select sum(“field_name”) as num_items from “measurement” where “tag1” =‘tag_value’ and time = $timeFilter GROUP BY “tag2”
So how can I the percentage of sum(“field_name”) of a particular value of tag2 in one query.