In case you missed the announcement: Alteryx One is here, and so is the Spring Release! Learn more about these new and exciting releases here!

Alteryx Designer Desktop Discussions

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

Find exact String in a Concatenated String

dinh_rsm
5 - Atom

Hello everbody,

 

I am fairly new to alteryx and have currently run into a problem with my workflow.

Basically I need to check users for actions. If they can do that they cannot do this.

I concatenated each users action into a long string. Then i am checking the actions (concatenated string) if they contain certain actions. If there is a match then the user has actions that they should not have. 

The problem is right now i am using a contains function: Contains([Concat_Value], [ListOfActions]) and this is giving me an inaccurate output since

there are values in the Concat_Value that have the string of an action in ListOfActions.

Example: 

concat_value : i go skiing, i go swimming, i go skiing

listofactions: i go, xxx, xxx

This gives me a hit. The user has conflicting actions but they actually do not since it is not an exact match.

It then matches: I run -> Conflicts with -> I go , although the user has i go skiing witch is then possible in this example. Only if the user has the action "i go" then it would be a conflict.

Basically how can i look for the exact string?

 

Thank you in advance!

Cheers

 

4 REPLIES 4
BS_THE_ANALYST
14 - Magnetar
14 - Magnetar

@dinh_rsm have you got any sample data with an expected output? ðŸ˜Ž

 

All the best,
BS

LinkedIN

Bulien
FrederikE
13 - Pulsar

Hey @dinh_rsm,

 

I think this is what you want? 

I do a split to rows before doing the check - this way your Contains-Function works. 

 

FrederikE_1-1678893422074.png

 

Christina_H
14 - Magnetar

It sounds like you only want exact matches, e.g. the list contains "i go" as a stand alone item, not "i go swimming".  If that's the case, don't concatenate the actions before matching.

Christina_H_0-1678893768501.png

 

dinh_rsm
5 - Atom

Hello everybody,

 

thank you for your input.

I tried it with your suggestion christina_h but i could not get it to run. I think the problem is that the ListofAction has 2 columns which indicate. If you have Action1 You cannot have Action2. I included a screenshot of the current flow.

Before the Join:

In the upper bracket. The rows are like Name, Value( which is the action), Concat_Value (a string of actions a user has).

The lower bracket is the action list which the rows are basically Action1, Action2 (If a user has a certain action1 they cannot have a certain action2).

The contains function :  Contains([Concat_Value], [ListOfActions])  as stated above gives me matches although the string is not exactly the same. Example with "I go" and "I go swimming". I get a hit for I go swimming although the string is "I go". 

I hope this makes things clearer.

Thank you for the help!

 

Alteryx_Problem.png

 

Labels
Top Solution Authors