Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Multiple If Statement with A Blank Field and A Numeric Value

sauce419
5 - Atom
 

Hi, I am trying to perform a multiple condition if statement. In each expression is revolves around two fields 'HCI' and 'Sty.' which are both vstring data types. In some cases the field the HCI field is empty so I captured and isempty field. Essentially this formula is trying to calculate an hourly rate based on the two field conditions. However, the  formula gives me a "parse error (361) malformed if expression #1).

 

Does anyone know why I am getting this error and if it has something do with the data types? I am trying to get a double output as I am trying to get an hourly rate.

 

 

 

 

2 REPLIES 2
alexnajm
18 - Pollux
18 - Pollux

I think you need to make all your ELSE IF parts into one word - ELSEIF

terry10
12 - Quasar

@alexnajm is right, you need to remove the space between ELSE and IF.

 

However, best practice could be to break your formula apart into logical pieces. It will save you a lot of headaches when having to troubleshoot issues or modify values.  For example, I noticed all of your CA16 are 1.25 and all of the CA14 are 1.0; instead of repeating this, value, you could set it once (I called it "Base"). All of the CHI =1 or 3 are *2 and HCI = 2 are 2*0.5. Instead of repeating that, you can set it once (I called it the Multiplier). Then the Shift Premium = [Base] * [Multiplier]. Now if you had to update the base or multiplier in the future, you only have to make the change in one place. 

 

I hope you find this useful. Workflow attached,

 

HCI Sty.PNG

Labels
Top Solution Authors