Hi Team,
I am trying to compare network traffic for this week vs last week in Grafana.
I already have two queries returning the traffic values correctly:
Query A → This week traffic
Query B → Last week traffic
The issue comes when I use the Transformation → Add field from calculation to calculate the sum/difference between the two datasets.
Grafana fails to compare the values correctly, and the calculation either returns:
null values,
incorrect totals,
or no matching rows.
It looks like the timestamps between the two queries are not aligning properly during the transformation.
My goal is to:
compare this week’s traffic against last week’s traffic,
calculate the difference or percentage change,
and display it in a single panel.
Has anyone experienced this issue before?
What is the best way to align timestamps or structure the queries so that Add field from calculation works correctly for week-over-week comparisons?
I am using Grafana with time series data.
Any guidance or examples would be appreciated.
Thanks.
Hey, what data source are you using? Prometheus has offset modifier, I bet Influx has something similar. Data sources are usually better at handling data transformations and they do not pose additional resource usage on Grafana instance.
Welcome to forum @chifundomlangeni20 have you looked at SQL Expressions

