I really need your help.
I am new in R shiny and I have to use 2 reactives functions.
I have a table of a DataBase which columns (id_cli, val_cli, date_cli)
example (1, 12, 2020-02-01); (1,30,2020-02-02); (2, 80,2020-02-03) etc.
I want to select the id_cli using the function selectInput
and from there select a date range using the dateRangeInput
function
This is my code :
date1 <- seq(from = min(clo$date_cli), to = max(clo$date_cli), by= "days")
tweet <- data.frame(date = date1, clo$val_cli, clo$id_cli)
selectInput(inputId="cli", label= "Choose client", choices = tweet$id_cli)
dateRangeInput(inputId ="date", label ="Choose date", start = min(tweet$date_cli)
end = max(tweet$date_cli),
min = min(tweet$date_cli),
max = max(tweet$date_cli)
)
query1 <-reactive({
tweet %>%
select(id_cli, val_cli, date_cli) %>%
filer(id_cli ==input$cli)
})
query2 <-reactive ({
query1()
filter(tweet, between(date, input$date[1] input$date[2])
})
The code takes all the date range of data but does not select by id_cli
which is input$cli
Someone can help me please ?