General Discussions

Discuss any topics that are not product-specific here.

Alteryx Practice workflow

Suryachoppakatla
7 - Meteor

Hello,

 

I would like to write a formula where the condition should give me the desired result as mentioned below

 

1. Based on the Recipients US TIN, the column should be able to identify if given data is for Entity or Individual, I do not mind if additional column need to be added

 

Example : If the TIN number starts with 3 (digits)-2(digits)-4(digits) - then it is Individual (eg: 123-22-1234)

                 If the TIN number starts with 2 (digits) - 7(digits) - then it is a Company (eg: 12-1234567)

 

2. Based on the above condition the "Recipient Last Name" should be able to determine if it belongs to Entity or Individual. If the client provides his TIN number

starts with 3 digit and writes his Company name in "Recipient Last Name", then the result should throw as Invalid because 3(digits) belongs to Individual

 

I tried using "Startwith" formula, but not able to figure out how to write the condition, so that Alteryx understand my formula and gives me desired result

 

Any help is highly appreciated

 

Regards,

Surya

2 REPLIES 2
BrandonKO
Alteryx
Alteryx

I'm not sure if I fully understand what you want the end result to look like. But I mocked up how you could easily identify whether someone is an "Individual" or "Company" based on the TI

N number. I also included an example of using the StartsWith() function. Hopefully this helps!

 

 

BrandonKO_0-1672282254408.png

KrishnaChithrathil
11 - Bolide

@Suryachoppakatla 

Does this help you? And I'm not pretty clear with the last two points.

 

Formula:

IF

    REGEX_CountMatches([TIN Number], "-") = 2 and EndsWith(Left([TIN Number],4), '-') and EndsWith(Left([TIN Number],7), '-') and            StartsWith(Right([TIN Number], 5), '-')

THEN

    "Individual"    
ELSEIF

    REGEX_CountMatches([TIN Number], "-") = 1 and EndsWith(Left([TIN Number],3), '-') and StartsWith(Right([TIN Number], 8), '-')

THEN

    "Company"
ELSE "Invalid" ENDIF

 

 

KrishnaChithrathil_0-1672292136590.png

 

Labels