1

I have following formula that works in ArcGIS within the Raster calculator:

Con (("%P%"-"%ETP%)<0, "%RUx%"*Exp (("%P%"-"%ETP%")/"%RUx"), Con (("%RUx%"+"%P%"-"%ETP%")<"%RUx%","%RUx%"+%P%"-"%ETP%","%RUx%"))

I want to use it in QGIS 3.16 or QGIS 3.4. I made some modifications to make it work in the Raster calculator of QGIS, but I still get an Error parsing formula:

if(("P@1" - "ETP@1" )< 0,"RUx@1" *(("P@1" - "ETP@1") / "RUx@1" )^2.71828, if (( "RUx@1"+"P@1"-"ETP@1") < "RUx@1" ,"RUx@1"+"P@1" - "ETP@1","RUx@1"))

Which modifications are needed to make it work?

GisUser
  • 653
  • 2
  • 20
  • https://gis.stackexchange.com/questions/110121/writing-conditional-statements-in-qgis-raster-calculator – BERA Mar 10 '23 at 11:18
  • @BERA Thank you. I already read this topic and tried to apply it to my case unsuccessful – GisUser Mar 10 '23 at 11:21

1 Answers1

1

The following works:

(("P@1" - "ETP@1" < 0)*"RUx@1" *("P@1" - "ETP@1") / "RUx@1" ^2.71828)+( "RUx@1"+"P@1"-"ETP@1" < "RUx@1" *"RUx@1"+"P@1" - "ETP@1"*"RUx@1")+"RUx@1"

* symbol should be used instead of ,

+ symbol should be used between two conditions

GisUser
  • 653
  • 2
  • 20