Error in filter_impl(.data, quo) :
Evaluation error: Operation not allowed without an active reactive context.
(You tried to do something that can only be done from inside a reactive
expression or observer.).
Since your reprex is not executable, I am not able to reproduce your error. However, it could be the case that you are trying to access a reactive element inside the Server function but outside of any Shiny reactive functions. Check this SO answer. Wrap your filter component within a reactive and it should work.
I think the problem is exactly as written, you try to use date_input() outside a reactive context. You could try to wrap date_input() in isolate(). But then, of course, data2 will not be automatically updated when input$analysis_period and thereby date_input() changes.
If date_input() changes, there is no way that data2 can automatically update, even though that is probably your intention. Therefore, this code has a bug, and that error message is our way of telling you that: you need to introduce either a reactive expression (to calculate a derived value) or an observer (to perform an action). In this case, data2 is a derived value. The correct code looks like this:
data2 <- reactive({
df <- data[, c("A", "B", "C")]
# I'm pretty sure you don't mean this. Maybe date == date_input()?
df <- filter(df, date_input())
df
})
And everywhere you were planning to use data2, use data2() instead.