Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Working with InfluxDB tags #35

Open
bibek687 opened this issue Sep 28, 2020 · 0 comments
Open

Working with InfluxDB tags #35

bibek687 opened this issue Sep 28, 2020 · 0 comments

Comments

@bibek687
Copy link

Requirement

I'd like to display a stacked bar chart of monthly overviews of no. of devices.
The InfluxDB schema is that we have tag for the month (not directly a "time" type, but a string from the script). Example is MonYear = SEP2020
There are Main device categories, and device subcategories, both stored as tag as well (e.g. MainDevice, SubDevice).
We have a field called value, which is 1 when there is a new addition and we sum/ count the value to get the total.
So, I'd like a chart which shows the number of devices in SubDevices of a particular MainDevice over each month.

Currently

My query is
SELECT sum("value") FROM "measurement" WHERE ("MainDevice" = 'External Device') AND $timeFilter GROUP BY "SubDevice", "MonYear"

With this, I just get the following. When I just use one group by tag, it works fine though.
Screenshot from 2020-09-28 14-19-57

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant