Organizing multiple-tagged data?

Hello! Working with a small project and I’m having difficulties using the exported data, could use some advice!

The usecase: we have multiple-tagged data that we want to aggregate and graph by mean/sum

Picture a bakery selling pastries. They want to keep track of inventory by categories, such as “flavour” and “type”. An example intake in influx would look like this:

inventory,type=croissant,flavour=plain count=42 t=0
inventory,type=donut,flavour=chocolate count=30 t=0
inventory,type=donut,flavour=vanilla count=15 t=0

inventory,type=croissant,flavour=plain count=38 t=1
inventory,type=donut,flavour=chocolate count=26 t=1
inventory,type=donut,flavour=vanilla count=12 t=1


Now if you do simple graphing with flux or influxql summing to eg display total of donuts over time, it looks fine at first, but when you zoom out, the time window eventually covers several data batches, multiplying quantities!

What’s the correct way to do this?

You could MAYBE coalesce it all into a single measurement eg
inventory count_croissant=40,count_donut_vanilla=30,count_donut_chocolate=12 0

But that completely defeats the point for aggregating

Any advice? Thanks in advance!

Hello @fira,
What is the Flux query that you’re using?
It seems like you might be using the aggregatewindow() function with a default window period value, which will aggregate based on how long your querying data for.
If you remove that function in the script editor you will get your raw data.
Does that help?