In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests after December 31, 2025. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

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

Search One Column from Another Column using Wildcard function like in SQL

FUB_IA_SQL_GUY
6 - Meteoroid

I am in the process of trying to import data from a CSV file and add it to a relational database. In the CSV file there are two columns that are as following:

  1. List of Approvers - Which has a list of personnel that can approve a record(Row)
  2. Approvers - The actually approver of the record(Row)

I am wanting to create a flag that would verify that the actual approver was in approvers list column. Below is an picture of what a final table might look like.

FUB_IA_SQL_GUY_0-1682617717453.png

 

Below is how it is done in SQL with  Sample Data.

 

 

 

Create Table #Temp 
([List_ofApprover] nvarchar(135),
[Approvers] nvarchar(125));


  INSERT INTO #Temp VALUES
  ('bgates,sjobs, or tcook','sjobs'),
  ('mduncan','mduncan'),
  ('mcook,jdavis, or hsmaith','mdavis'),
  ('triddle,hpotter','hpotter'),
  ('martha & Marry','martha'),
  ('martha & Marry','marry')

  Select * 
  ,CASE WHEN [List_ofApprover] LIKE CONCAT('%',[Approvers],'%') Then 'Yes' Else 'No' End [Approver in List]
  From #Temp

 

 

 

 

 

I created some sample data in Alteryx and attached the flow file. Does anyone have a good suggestion to help me create this flag in my Alteryx workflow? Thanks in advance for all of the help.

 

3 REPLIES 3
DanielG
12 - Quasar

@FUB_IA_SQL_GUY  - A formula with

 

IF Contains([List of Approvers],[Approver]) then "Y" else "N" end

should work

DanielG
12 - Quasar

Just name the field in the Formula Tool "Approver in List" and you should be all set

 

FUB_IA_SQL_GUY
6 - Meteoroid

I didn't realize it was that simple, wasn't sure if wildcard needed to be used. Thank you for the help.

Labels
Top Solution Authors