Display Stacked Series


Is there any way to stack different series of data.
Please see attached screenshots.
At the moment, series are displayed next to each other, not on the top of each other.



Yes, combine your queries into one query. Use regex for the table name to combine those queries together.

An example:


Could you please explain based on my 2 queries because it sounds very complicated to me :frowning:

SELECT sum(“value”) FROM “FRTMAP_TAGS_JC_DEPT_DEI” WHERE $timeFilter GROUP BY “year”, “week”


SELECT sum(“value”) FROM “FRTMAP_TAGS_JC_DEPT_DEX” WHERE $timeFilter GROUP BY “year”, “week”



Like this I think. This part of the regex (I/X) matches both I and X - the only difference between the two table names.

SELECT sum(“value”) FROM /FRTMAP_TAGS_JC_DEPT_DE(I/X)/ WHERE $timeFilter GROUP BY “year”, “week”


No quite :frowning:

error parsing query: error parsing regexp: missing closing ): FRTMAP_TAGS_JC_DEPT_DE(I at line 1, char 25


oh sorry - typo:

SELECT sum(“value”) FROM /FRTMAP_TAGS_JC_DEPT_DE(I|X)/ WHERE $timeFilter GROUP BY “year”, “week”

This: (I/X) should be (I|X) The pipe symbol means OR.


Thanks !
SQL works without any errors but graph still not displayed as stacked despite Stack box is ticked :frowning:


You can group by tag - if you have a unique tag value per table?


Sorry, I don’t follow you.
I already Group By Year and month …


You don’t know what tags are? Here are some docs to learn more about InfluxDB:

I just figured it out. You are not using time mode:


Stacking does not work in series mode. As you are grouping by time, I’m not sure why you would use series mode?

Also, you can group by time with InfluxDB so don’t think you need to make special tags for year, month. But maybe you have a special case that requires them?


I use year, month and week time because I want to filter by week (Monday to Sunday), month (whole month, not 30 days with InfluxDB…)-… etc.
InfluxDb and Grafana don’t give the flexibility to filter by full month … You can use 30 days … but some months are 30 days, 31 days, 28 and even 29 for February.
By using months and week tags, I can group my data correctly.

This is also why I use the Serie Mode … when the Timefilter is not practical.


If you use Series mode, then stacking will not work unfortunately.


Shame :frowning:
Any plans to make it work ?
Any suggestions how I could achieve this ?
Thanks for your help.


Have you find solutions at your problem ?