General Discussions

Discuss any topics that are not product-specific here.
SOLVED

unknown variable error in a formula

Karl_Spratt
8 - Asteroid

Hi Community,

Can someone explain how I can fix this error?

Both the Country & route columns are coming into the W/F as V_String  

Example the route for a delivery in France would be FR-140, the Country Code would be FR so I'm saying if Route is populated pull the first 2 digits FR if empty ( no delivery created) pull the country code 

 

Can someone explain the fix here please. 

 

TIA,

Karl. 

3 REPLIES 3
Peachyco
11 - Bolide

Please note the two things I've indicated in your screenshot:

  1. The data type of [Country] is editable here. This tells me that the field [Country] is being created by this same Formula Tool. This also means that [Country] doesn't exist yet at this point (at least from the perspective of the Formula Tool).
  2. You are using [Country] as a variable at the exact same time that you're creating [Country]. This is the cause of the error.

Alteryx - Karl_Spratt unknown variable.png

 

If you are certain that [Country] is supposed to exist prior to this Formula Tool, you have to check the earlier parts of your workflow because it's being dropped along the way.

caltang
17 - Castor
17 - Castor

Yeap - as @Peachyco pointed out, your Country field does not exist yet, so if you put it in the same formula to make it exist, you're circular referencing. To avoid this, you can make the Country field first, then make a new field in the following + space referencing [Country] as it is made.

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
Karl_Spratt
8 - Asteroid

Thanks guys, yes I found in my select tool earlier in the W/F the country field was unchecked so not coming into that part of the WF / Formula.

I have fixed the issue - Thanks all for your help here as always....

 

Cheers,
Karl. 

Labels
Top Solution Authors