I'm trying to make a time series plot based on a table with 5 columns: three character columns which determine where the data comes from and what it's about, the date the data was collected, and the value of some variable at that time.
I have three lists, one for each character column, which allow the user to choose which data to look at in a time series plot, as shown below.
When the user selects multiple items in the lists, SAS adds all of the values that satisfy the filter and displays the total in a single line.
What I want is for SAS to create one line for each possible combination of ticked items in the list to allow them to look at multiple sources of data at the same time. In this case, as there is 1 item selected in the first character column, 2 in the second and 2 in the third, I would like 1x2x2=4 lines, as shown below.
I made the above image using MS Paint and an unrelated time series plot that uses multiple Measures, which is why the data is inconsistent.
So far, my best attempt at getting a multi-line time series plot was by transposing the table on the three character columns using PROC TRANSPOSE, uploading the modified dataset to CAS, then using the columns representing each combination of data sources in the "Measure" parameter of the time series plot.
Unfortunately, this doesn't allow the user to choose which columns are shown without access to editing mode, as I don't know how to get the user to choose which columns are put in the "Measure" parameter of a time series plot without editing the plot itself. If there is a way to let the user choose which columns to analyse in a time series plot, that would be an acceptable (albeit suboptimal) solution.
If you know SAS VIYA can't do this (or I need to use something other than a time series plot), please tell me so I can seek an alternative solution.
Without knowing what your data looks like here is a possible solution with fake data.
The data for the example looks like this, as you can see I have two category columns, a date column and a value column.
Steps:
The resulting report will look like this:
Give it a try
Without knowing what your data looks like here is a possible solution with fake data.
The data for the example looks like this, as you can see I have two category columns, a date column and a value column.
Steps:
The resulting report will look like this:
Give it a try
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.