0

Two condition if function

Hi how do I do an if function with two conditions? Can I use AND? like so

if Fuel_Type = "BEV" then text ("") else
if Fuel_Type = "PHEV" AND 'ICE Max Power - kW' > 0 then
round('ICE Max Power - kW',0)
else text("NK")
end
end

3 replies

null
    • Jorg
    • 5 yrs ago
    • Reported - view

    Hi, 

    yes, that is right - except the AND must be written in small letters:

     

    and

    Best, Jörg

    • wynand
    • 5 yrs ago
    • Reported - view

    Thanks, Jorg but I get a return type mismatch for then and else expressions: number, string at line 5, column 3 for thfunctionon

    if Fuel_Type = "BEV" then text ("") else
    if Fuel_Type = "PHEV" and 'ICE Max Power - kW' > 0 then
    round('ICE Max Power - kW',0)
    else text("NK")
    end
    end

    • wynand
    • 5 yrs ago
    • Reported - view

    found the problem - text(round('ICE Max Power - kW',0))

Content aside

  • 5 yrs agoLast active
  • 3Replies
  • 2339Views