Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Shortest method required - choosing the correct combination

ankitsingh2063
8 - Asteroid

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  
4 REPLIES 4
danilang
19 - Altair
19 - Altair

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

ankitsingh2063
8 - Asteroid

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  
danilang
19 - Altair
19 - Altair

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

ankitsingh2063
8 - Asteroid

Thank you so much @danilang 

Labels