Karthik R
Hello You should be able to use expressions if you have analytical functions. You can see the list of all the available variables, functions, and operators here.
For certain operations, you can use as well. I'm not sure about your usage but I'd look into the link I shared to understand if you can successfully attempt what you are currently doing with the UDF.