Using IF and Replace functions
- 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
I have a workflow with data that looks like
company_name | contract_agreement | contract_agreement_ID |
Mcdonalds | 78945 | 7529 |
Popeyes | 78459 | |
Zaxbys | 78421 | |
Freddys | 84579 | |
Popeyes | 84124 |
I am trying to use the formula tool with "IF [customer_company_name] = 'Popeyes' THEN Replace([contract_agreement], "*", [contract_agreement_ID]) ELSE [contract_agreement] ENDIF". To replace all of the different contract agreements that popeyes may have but the current formula is not working. So the new data would look like.
company_name | contract_agreement |
Mcdonalds | 78945 |
Popeyes | 7529 |
Zaxbys | 78421 |
Freddys | 84579 |
Popeyes | 7529 |
Any help is appreciated.
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I do have a similar workflow like @binuacs.
Please refer to the same.
However I noticed, the data you have pasted in the input have trailing whitespaces.
Please do use the Data Cleansing tool to remove the Trailing whitespace.
Many thanks
Shanker V
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Tried one tool solution, please check whether this helps you.
Input:
Output:
Many thanks
Shanker V
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Formula 1: Helps to make sure the agreement_ID si filled as 7529 in all the rows.
if (IsNull([contract_agreement_ID]))
then 7529
else [contract_agreement_ID]
endif
Formula 2:
IF ([company_name] = 'Popeyes')
THEN [contract_agreement_ID]
ELSE [contract_agreement]
ENDIF
Many thanks
Shanker V