I have data from a forecast model, i.e. I have the actual and predicted values. The idea is to represent the predicted values as a dashed line in a line graph.
Real Value = Realizado (in Portuguese)
Predicted Value = Previsto (in Portuguese)
The only way you'll be able to do this (some lines are solid, some lines are dashed) is to create a custom graph where you have stacked line charts on top of each other. I think you might be able to get away with two line charts where one is for Actual and solid, and the other is for Previous and dashed but depending on your data you might need more.
If you've never used Graph Builder, the documentation is here (https://go.documentation.sas.com/doc/en/vacdc/v_031/grbldrug/titlepage.htm) and the basic flow would be something like this:
- Create a new graph in Graph Builder
- Drag and Drop two line charts on top of each other
- In the Options for Line Chart 1, make sure line style is solid (default)
- In the Options for Line Chart 2, change the Line Style to dashed.
- Turn on other options for each as you see fit, like Markers, data labels.
- In the Roles for each line chart, edit the Response/Measure role and check the box for allow multiple measures. This should allow you to add all of the Actual measures to one line chart, and all of the Previous measures for the other line chart.
This may take some trial and error to get it right but hopefully that's enough to get you going!
The only way you'll be able to do this (some lines are solid, some lines are dashed) is to create a custom graph where you have stacked line charts on top of each other. I think you might be able to get away with two line charts where one is for Actual and solid, and the other is for Previous and dashed but depending on your data you might need more.
If you've never used Graph Builder, the documentation is here (https://go.documentation.sas.com/doc/en/vacdc/v_031/grbldrug/titlepage.htm) and the basic flow would be something like this:
- Create a new graph in Graph Builder
- Drag and Drop two line charts on top of each other
- In the Options for Line Chart 1, make sure line style is solid (default)
- In the Options for Line Chart 2, change the Line Style to dashed.
- Turn on other options for each as you see fit, like Markers, data labels.
- In the Roles for each line chart, edit the Response/Measure role and check the box for allow multiple measures. This should allow you to add all of the Actual measures to one line chart, and all of the Previous measures for the other line chart.
This may take some trial and error to get it right but hopefully that's enough to get you going!
Thank you so much for the suggestion!!!
It exceeded my expectations and even helped me with other issues I was facing!
Thank you for laying everything out as a guide and also showing the documentation reference!
I have another question regarding this solution @HunterT_SAS
Is it possible to create independent filters for Charts 1 and 2 created through the customization?
The way it works today, if I apply a year filter for 2016, for example, the chart only shows the two lines: forecast and actual. But I would like to be able to show only the forecasts for 2016 and 2017, for example, and the actuals from a different year.
Would you like help writing a follow-up message to ask for that feature or clarification?
No problem at all and glad that worked for you!
For this second question do you mind starting a separate thread for that? This will be a different solution so would be more helpful in a different thread. AND I believe we can make this work so I'll respond there.
Catch the best of SAS Innovate 2025 — anytime, anywhere. Stream powerful keynotes, real-world demos, and game-changing insights from the world’s leading data and AI minds.
See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.
Find more tutorials on the SAS Users YouTube channel.