Alteryx Designer Desktop Discussions

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

Trouble with Conditional Statement with Numeric formula based on V-String column

sureslala
7 - Meteor

Hello

I'm having trouble with a conditional statement referencing a 'V-String' type column, then using numeric column type 'Double' columns to calculate an Output in data type 'Double'.

 

The highlighted 'yellow' column is my required output, derived using the impact formulas.

 

 

sureslala_0-1666986213514.png

 

My flawed formula is below and in attached workflow. I thought 'IF' statement with ''ToNumber' would be best way to go but keep getting a 'malformed error' and 3rd formula just doesn't compute.

 

sureslala_2-1666986687495.png

 

Could someone please explain best way to use conditional statements based on a V-String type column, then using 'double' type columns to compute a math formula to give numeric (double type) output?

 

Stuck in the mud with this one sorry.

 

Thanks!

Sures

 

 

2 REPLIES 2
Luke_C
17 - Castor

Hi @sureslala 

 

I seem to have gotten this working, a few notes on what was wrong:

  • On the first ElseIf parenthesis were missing
  • All of the impact value formulas did not align to the values in the text input. For example the text input has 'External - Internal' and your formula has 'External-Internal'.
  • There was no final else clause or endif in the formula (I set this to null but you can make it whatever)
  • I don't think the ToNumbers are doing anything, but don't do any harm
  • On the text input your Positions had trailing spaces and commas which caused data to be lost following the select tool. For sake of making this work I tweaked that, but if that's how your input is you may need to add some steps to cleanse the data. 

 

Luke_C_0-1666988519571.png

 

sureslala
7 - Meteor

Thanks Luke looks like I was a little careless in my formulas and didn't pay enough attention to my data. Lesson learnt! thanks again. I've got my test example to work, will now hopefully apply same lessons to my main 

Labels