Alteryx Practice workflow
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
- Labels:
- Alteryx Practice
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
![](/skins/images/303A6AD65FCA043F1D2938424191616C/responsive_peak/images/icon_anonymous_message.png)