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

Year over year change when the value is a string

mlim0806
7 - Meteor

Hello community, 

 

This is a tough one!

 

In the sample attachment I have a raw data sheet that includes years, employee and ID, position code and readiness. I would like to create a new column that calculates the change in readiness from the prior year. In other words, asked, did an employee increase, decrease, or remain the same in their readiness level to take on the position from 2022 to 2023? I imagine the logic to look something like,   "IF [year=2022] and [readiness level=Ready Soon] and [year=2023] and [readiness level=Ready Later] THEN [Change in readiness= decrease]"

 

Currently, I manually calculate this change using these steps,

1) Separate each year into its own tab

2) Concatenate the employee ID and the position code to create a unique ID

3) Create a new column and vlookup the previous year's readiness

4) Manually look at current year readiness and previous year readiness to determine whether the employee increased, decreased, remained the same, or if it was a new readiness level added. 

 

 

Readiness ranking:

Ready Now

Ready Soon

Ready Later

Ready Longer Term

8 REPLIES 8
Qiu
21 - Polaris
21 - Polaris

@mlim0806 
Can you clarify that for Paul, he has Readiness as "Ready soon" for year 2020.
But in Tab "2021", column "2020 Readiness", the value for Paul is "#N/A".

mlim0806
7 - Meteor

Great callout @Qiu .. in the raw data you'll notice the position code is different. It was to show that an employee can be on multiple positions with different readiness levels. This is why I concatenate the employee ID with position code to create a unique count for each employee/position.  

Yoshiro_Fujimori
15 - Aurora
15 - Aurora

Hi @mlim0806 ,

 

I think I followed your requirement.

I hope this helps.

 

Workflow

Readiness_1.png

Output

For simplicity, I converted the Readiness ranking to numbers.

You can convert back to the original strings if you prefer.

Also I did not put the specific years in the column name of the sheet.

ConcatYearEmployeeEmployee IDPosition CodeReadinessReadiness_PrevYrChangeFromPrevYr
235699992021Jeannie2356999922Same
526311112021Drake5263111134Decrease
538962222021Sean5389622244Same
574121112021Paul5741211130New
652141112021Kyle6521411132Increase
Qiu
21 - Polaris
21 - Polaris

@mlim0806 
I had almost same approach as @Yoshiro_Fujimori 😂

0817-mlim0806-A.PNG0817-mlim0806-B.PNG

mlim0806
7 - Meteor

@Qiu @Yoshiro_Fujimori  this is great, I didn't think to assign a numerical ranking for the readiness. @Yoshiro_Fujimori I was not able to open your workbook due to version :( 

 

If we decide to add a new readiness level "Ready in Emergency", but it doesn't necessarily have a spot in the ranking, it's a category of its own. Could I assign the rep to 0 and it would then be... ? 

 

Expression: if isnull([Row-1:Rep]) then 'New' else if [Rep] - [Row-1:Rep] >0 then 'Increase' else if [Rep] - [Row-1:Rep] =0 then 'Ready in Emergency' elseif [Rep] - [Row-1:Rep] < 0 then 'Decrease' else 'Remained the same' endif endif

Qiu
21 - Polaris
21 - Polaris

@mlim0806 
Glad to be any help.
[Rep] - [Row-1:Rep]  is having 3 status >0, =0, <0.
else 'Remained the same' is actually using the condition =0. so we can not use =0 for  'Ready in Emergency' anymore.

Can we assign other condition for  'Ready in Emergency'?

mlim0806
7 - Meteor

The tricky part is, this is also a manual piece. Current state, we only know if the individual is also Ready in Emergency by looking at additional comments which is a free text field. Is it possible to create some version of "Find = Ready in Emergency" in [Comments] and assign 1 or 0, or Yes or No value in a separate column? 

Updated file attached. 

 

 

mlim0806
7 - Meteor

 @Yoshiro_Fujimori  Hello, I am revisiting this item as it appears the solution may not have worked on all records as expected on my actual dataset. Are you able to resend your solution on a downgraded Alteryx file type yxmd? 

Labels
Top Solution Authors