community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
Upgrade Alteryx Designer in 10 Steps

Debating whether or not to upgrade to the latest version of Alteryx Designer?

LEARN MORE
SOLVED

Shortest method required - choosing the correct combination

Hi,

 

This may sound a bit silly, but I am trying to solve this:

 

If Employee or Manager comment sufficient for 50% or more of the instances (rows) in the below data, then output should put a "Yes" against that employee in a unique record.

 

Input data:

IDEmployee Comment AvailableEmployee Comment SufficientManager Comment AvailableManager Comment Sufficient
1YesYes  
1  YesYes
1YesYes  
1  YesYes
1YesYes  
1  YesYes
1YesYes  
1  YesYes
1YesYes  
1  YesYes
2YesYesYesYes
2YesYesYesYes
2    
2YesYesYesYes
2YesYesYesYes
3YesYes  
3  YesYes
4YesYes  
4YesYes  
4YesYesYesYes
4  YesYes
5YesYes  
5  YesYes
5YesYes  

 

Output data:

IDTotal Comments Sufficiency by EmployeeTotal Comments Sufficiency by ManagerSufficient by Both
1Yes  
2YesYesYes
3YesYesYes
4Yes  
5Yes  
Magnetar

Hi @ankitsingh2063 

 

I'm a little confused by your results.  

 

ID =1  

Rows=10

Managers Comment and Sufficient = 5 (50%)

Total Total Comments Sufficiency by Manager = No

 

ID =3  

Rows=2

Managers Comment and Sufficient = 1 (50%)

Total Total Comments Sufficiency by Manager = Yes

 

Why are the results different in these cases?

 

Dan

Sorry, my bad!

 

This is how the output should look like

 

IDTotal Comments Sufficiency by EmployeeTotal Comments Sufficiency by ManagerSufficient by Both
1YesYesYes
2YesYesYes
3YesYesYes
4Yes  
5Yes  
Highlighted
Magnetar

Here you go @ankitsingh2063 

 

WF.png

The Cleanse Data tool removes all the leading and trailing spaces.  The Summarize tool groups by ID and calculates the total records for each ID and the Sufficiency records for Employees and Managers.  The formula tool does the math to determine if the comments reach the 50% mark and adds "Yes" in the "Both" column if both conditions are true

 

Results

 

Results.png

Note that your input data didn't match your results for ID 4, 4 records and 2 manager comments, so I added an extra record with no manager comments

 

Dan

Thank you so much @danilang 

Labels