We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Flagging Grouped Records which have more than one reason

Masond3
8 - Asteroid

Team, 

 

I am drawing a blank and struggling of a way to solve this 

 

AIM : To create a helper column that flags groups which have different reasons associated to them 


Input 

GroupReason
839Exact First Name 
839Cant Identify
839Exact First Name 
2Exact First Name, Exact Last Name, Exact Email
2Exact First Name, Exact Last Name, Exact Email

 

OutPut 

 

GroupReasonHelper
839Exact First Name Y
839Cant IdentifyY
839Exact First Name Y
2Exact First Name, Exact Last Name, Exact EmailN
2Exact First Name, Exact Last Name, Exact EmailN

 

 

Regards
Masond3

9 REPLIES 9
Felipe_Ribeir0
16 - Nebula

Hi @Masond3 

 

Try this formula, it is basically counting "," and then assigning the label (the contains formula would work for your case too):

 

 

IF REGEX_CountMatches([Reason], ',') = 0 
THEN 'Y' 
ELSE 'N' 
ENDIF

 

 

REG.png

Masond3
8 - Asteroid

Hi, 

 

I dont think that would work as some of my reasons do have "commas" associated. 

Any other potential solutions ? 

Felipe_Ribeir0
16 - Nebula

Hi @Masond3 

 

Can you share some of the reasons that contains comma? Or even all possible reasons. 

Masond3
8 - Asteroid

These are the current values i have for reason

 

Exact First Name, Exact Last Name, Exact Email
Exact L4, Different l5, Name with Nickname Reveresed First Name or Reveresed Last Name, Exact Email
Cant Identify
Name with Nickname Reveresed First Name or Reveresed Last Name, Exact Email
Exact L4, Different l5, Exact First Name,  Exact Last Name, Exact Email
Exact L4, Exact l5,Exact Last Name, Exact Email
Exact L4, Exact l5, Exact First Name, Exact Last Name, Exact Email
Exact L4, Exact l5,Exact First Name, Exact Email
Exact L4,  Different l5, First Name with NickName,  Exact Last Name, Exact Email
Dummy
First Name with Nicknames, Exact Last Name
Exact L4, Exact l5, Name with Nickname Reveresed First Name or Reveresed Last Name, Exact Email
Name with Nickname First Name or Name with Nickname last Name, Exact Email
Exact L4, Exact l5,  First Name with NickName,  Exact Last Name, Exact Email
Exact L4, Exact l5, Exact Reveresed First Name or Reveresed Last Name, Exact Email
Exact Reveresed First Name or Reveresed Last Name, Exact Email
Exact L4, Different l5, Exact Reveresed First Name or Reveresed Last Name, Exact Email
Masond3
8 - Asteroid

Hey  

I think i may of done it by using the Sumrasiation tool

 

  • Group by "Group"
  • Count Distinct by "Reason"

 

Then i can apply the following formula "if [CountDistinct_Reason] >1 THEN 'Y' ELSE 'N' ENDIF"


 

PhilipMannering
16 - Nebula
16 - Nebula

It doesn't look like any of these reasons have a comma in them. Think @Felipe_Ribeir0 's solution should work.

Felipe_Ribeir0
16 - Nebula

Hi @Masond3 

 

Maybe now i understood your problem, try this version:

Screenshot 2023-08-30 083054.png

 

 

Masond3
8 - Asteroid

Thats the one.

Took me ages to work through it, but you gave me some ideas in your formula. 

 

Huge thank you :)

Felipe_Ribeir0
16 - Nebula

@Masond3 

 

My first impression was that you had different reasons per row separated by comma:

Untitled.png

But you have different reasons with the same group sepparared by row.

 

I am glad it worked.

Labels
Top Solution Authors