Issue in if Statement

Hi all,

Can anyone please help me in if I can use the below condition logic. Because, first 2 conditions are correct, but when I execute any of the other 2, the app closes

ui.R

dateRangeInput("Date","",start = '', end = '',format = "yyyy-mm-dd",separator = "-"))
selectInput("Tic","",choices = c("ALL",as.character(ticker$Ticker)),selected = "ALL")
actionButton("Submit","Submit")

server.R

      observeEvent(input$Submit,{
      if(input$Tic != "ALL" && !is.null(input$Date)){
###  below is the sample code I use to render filter. This is for your reference
      (input$Tic ,input$Date[1], ,input$Date[2])
      }
      else if(input$Tic == "ALL"){
      ('ALL', '01/01/2018', '02/01/2018')
      }       
        else if(input$Tic == "ALL" && !is.null(input$Date)){
      ('ALL', input$Date[1], input$Date[2])
      } 
        else if (!is.null(input$Date)){
      (input$Tic,'01/01/2018', '02/01/2018')
    }
      (input$Tic ,input$Date[1], ,input$Date[2])
      }
        else if(input$Tic == "ALL" && !is.null(input$Date)){
      ('ALL', ,input$Date[1], input$Date[2])
      } 

Not sure what you are trying to do but you have two ", ," in the above statements. Does it fix the problem if you change it to ","?

Hi,

Actually my question if all my if conditions are proper :slight_smile:

I tried replacing it but did not work :frowning:

From reading your code I have no idea what you try to achieve. Could you explain what you want to do in a view sentences?

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.