Skip to main content
Known Participant
Sep 22, 2022 1:12 PM UTC
Solved

Getting error while using 3 nested if functions - Any changes i need to change ?

Here is my code 

I understand that error i how can i use the same nested if without error?

    harshitb6843
    Brainy
    Sep 22, 2022 1:14 PM UTC

    You have some unnecessary brackets in your code. Adding the correct syntax below. 

    if(
      local!val=1,
      35,
      if(
        local!val=2,
        45,
        if(
          local!val=3,
          55,
          65
        )
      )
    )

    Anyway, I would recommend using a!match() now instead of nested if(). 

    2 replies

    harshitb6843
    Brainy
    Sep 22, 2022 1:14 PM UTC

    You have some unnecessary brackets in your code. Adding the correct syntax below. 

    if(
      local!val=1,
      35,
      if(
        local!val=2,
        45,
        if(
          local!val=3,
          55,
          65
        )
      )
    )

    Anyway, I would recommend using a!match() now instead of nested if(). 

    Known Participant
    Sep 22, 2022 1:19 PM UTC

    It works as expected , Thank you harshit 

    Great Job