I'm trying to apply two independent year filters to a custom chart: one for actual values and another for forecast values.
The goal is for each filter to work independently and allow multiple selections. For example, the user should be able to select 2016 and 2018 for actual values, and at the same time select 2020 and 2022 for forecast values — displaying four distinct lines on the same chart: two for actuals and two for forecasts.
Currently, the chart behavior is incorrect: when applying a year filter (e.g., 2016), it always returns two lines — one for actual and one for forecast — for the same year. This prevents users from independently combining different years for each type of value.
The objective is to make the filters independent so that it's possible to freely combine multiple years of actual values and multiple years of forecast values in the same chart, without one filter affecting the other.
@HunterT_SAS
Currently, I managed to implement independent year filters by pivoting the data table, placing both forecast and actual values into the same column, and using an additional field to distinguish between the two. This solution allows me to filter years independently for forecast and actual data, and it's fully functional using standard chart components.
However, by using this approach, I lose the ability to use my custom chart configuration, where dashed lines visually represent forecast values and solid lines represent actual values. That visual distinction was previously handled in the custom chart logic, which relied on the values being in separate series or fields.
In other words, while the pivoted solution allows for functional filtering, it comes at the cost of losing the visual styling and behavior that was possible with the original custom chart setup.
What I need is a way to combine both functionalities:
Keep forecast and actual values in separate series (to enable visual customization, like dashed lines for forecasts),
But still allow for independent year filtering for each series.
This is not something VA can easily do. I thought I might be able to make this work but unfortunately so far each idea I come up with has ended up me up in the same position you have found yourself in. I hate to say it but I'm thinking this won't be possible.
The closest I can get is having a form of the pivoted table you mention where the forecast and actual values are part of the same column and then a second column that differentiates between the two. THEN I also included columns for each predicted and actual values as well so something like this, along with a calculation I made concatenating the Year and Type to be used for the filter.
Then my custom line chart uses Month, Actual Total, Predicated Total, and grouped by Year, so it looks like this:
Then the filter uses the concatenated item I made, and the lines themselves are right when used, but the legend is wrong and confusing because the legend will always include missing values:
I cannot find a way around this or a better solution I am afraid.
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.