I’m dabbling with a workbook to watch snow pack in Utah where I live. I’m able to get the data and can get the visualization that I want, but expanding it out to include past year would get tedious quickly.
I have a function that allows for passing the year as a variable them using it to select both the column and set the date range. The dates start Oct. 10 each year as that is when the water year starts. So water year 2022, started Oct. 10, 2021.
I tried a few different things, but can’t figure out a good way to capture the output in discrete variables. The dates line up right, but I would like to capture each as a separate variable but do it programmatically so I can change the date range without have to set all the variables.
Like this without having to set the output list. I would like to be able to process as an event service at time so I can overlap them and see how one year tracks compared to the next. That part of still work in progress. Any insight are welcome.
I’m not quite understanding your desire. You said, “I would like to capture each as a separate variable but do it programmatically so I can change the date range without have to set all the variables”. So, I’m confused about whether you need individual variables or not.
Using the code you’ve already built, you can just do:
If you need the TimeSeries data stored in a variable, just assign that expression to a variable. The variable will contain a List, which can then be accessed by position (if you need the individual year data time series data). Or you just use the variable as a way to simplify the DateListPlot expression. Something like this: