Adding Data Sets To Charts

When adding data sets to charts, does each data set need a query? For instance, do I need a data set for each year if I am adding a line graph for each year of income totals?

What I have so far is one line that uses this query:

SELECT month(service_date) as “month”, sum(service_price) as TotalAmount
FROM service
WHERE year(service_date) = :P1
AND service_price > 0
GROUP BY month(service_date)
ORDER BY month ASC

:P1 = 2022

If I want to add another line showing the income totals for year(service_date) = 2021, would this be considered another data set?

I’m guessing that the above query can’t be used to display more than one data set. I was hoping to show these two graphs as one graph with two lines (one for previous year and the second for the current year) on one page. As see in the image below:

Would something like what George mentioned below work?

I’m struggling with this one right now - has anyone else done this?

Any progress on this? I am struggling as well. One key purpose of a graph is to compare 2 different data sets… very redundant having 2 seperate graphs.

Hello @teodor, has there been any progress on the chart?

Please provide some more details about this?

possibility of having two sources

Please post a new topic and explain your requirements there, explaining in details what are you trying to achieve.
This is an old topic

2 Likes