Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Community is experiencing an influx of spam. As we work toward a solution, please use the 'Notify Moderator' option on the ellipsis menu to flag inappropriate posts.
Free Trial

Alteryx Designer Desktop Discussions

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

Help! Looping (?)

Chelseaa
7 - Meteor

Hi all, im pretty new to alteryx and i need some help: 

 

This is my input file:

NameDepartmentTeamSub-teamTag to projectJan20Feb20Mar20Apr20May20Jun20Jul20Aug20Sep20Oct20Nov20Dec20Jan21
JohnAA1A1-1 1111100000000
JohnAA1A1-2 0000011110000
JohnBB1B1-3 0000000001111
SamCC1C1-2C0001111111111
SamCC1C1-2B000-1-1-1-1-1-1-1-1-1-1
SamCC1C1-2A0111111110000
MaryBB2B2-1B0000011111110
MaryAA2A2-1 0000000000001

 

Context: I am trying to track the movement of the people in the company based on the current month (i.e. November 20) and each line/row represents 1 movement, and "0" or "-1" means that this person is not longer in that particular department, team, sub-team & tagging to project for the month.

eg. For JOHN: 

row 1: John was in Dept A, Team A1, subteam A1-1, and not tagged to any project, from Jan20 to May20 [old movement]

row 2: then John moved to Dept A, Team A1, subteam A1-2, and not tagged to any project, from Jun20 to Sep20 [old movement]

row 3: then John moved to Dept B, Team B1, subteam B1-3, and not tagged to any project, from Oct20 to Jan21 [current movement]

 

eg. for SAM:

row4: Sam is in Dept C, Team C1, subteam C1-2, tagged to project C, from Apr20 to Jan 21 [current movement]

row 5: Sam was in Dept C, Team C1, subteam C1-2, tagged to project B, from Apr20 to Jan 21 [old movement]

row 6: Sam was in Dept C, Team C1, subteam C1-2, tagged to project !, from Feb20 to Jan 21 [old movement]

--> from Sam example, we can see that the sequence of events is jumbled up, Row 6 happened first, then Row 5 then Row 4

 

**for row 5 &6, Sam, note: the -1 means that he is being removed from the tagging of project A (because -1) and that line is tagged to project B because we want to have a -1 line under Project B (for internal calculations)

 

This is the output i desire - column in red, i want to identify which lines/row are the old movement or New (current), any future movements are considered as New/current movements too:

NameDepartmentTeamSub-teamTag to projectJan20Feb20Mar20Apr20May20Jun20Jul20Aug20Sep20Oct20Nov20Dec20Jan21Old/New?
JohnAA1A1-1 1111100000000old
JohnAA1A1-2 0000011110000old
JohnBB1B1-3 0000000001111new
SamCC1C1-2C0001111111111new
SamCC1C1-2B000-1-1-1-1-1-1-1-1-1-1old
SamCC1C1-2A0111111110000old
MaryBB2B2-1B0000011111110new
MaryAA2A2-1 0000000000001new

 

I have thought of using Multi Row as a tool but i am not sure if this is the correct tool to use ..? and i also have no idea how to frame the conditions

 

EDIT: Mary has 2 "New" because her 2nd line is a forecasted movement, so she is forecasted to move to a new team in Jan21 (she will be in the first team from Jan20 to Dec20 then move to another team in Jan21), so moving to another team creates another line/row.

 

 

Thank you all in advance, really appreciate your help! 🙂 apologies that it is a long wall of text.

 

 

 

 

8 REPLIES 8
Qiu
21 - Polaris
21 - Polaris

@Chelseaa 
Seems very complicated.😁
Why Mary gets two "new"?

atcodedog05
22 - Nova
22 - Nova

Hi @Chelseaa 

 

I donno i applied a simple logic i am getting output same as yours. It might be the right approach but please do take a look.

 

atcodedog05_0-1605245361759.png

 

Hope this helps🙂

Chelseaa
7 - Meteor

Hi @Qiu! 

 

Thanks for taking the time out to read my problem 🙂

 

Mary has 2 "New" because her 2nd line is a forecasted movement, so she is forecasted to move to a new team in Jan21 (she will be in the first team from Jan20 to Dec20 then move to another team in Jan21), so moving to another team creates another line/row

Chelseaa
7 - Meteor

hi @atcodedog05

 

Thanks for the attempt but that is not what i am looking for.

 

The "New" or "Old" is dependent on the current month we are in right now. Eg. it is november now and i would like to find out the movement for each person (whether its old or new) so i cannot use that logic 😞

Qiu
21 - Polaris
21 - Polaris

@Chelseaa 
I hope I get your logic correct.
Kindly check and give comments.

1113-Chelseaa.PNG

Chelseaa
7 - Meteor

@Qiu 

 

Yes it works!! Thank you so much for your help!!! life savior 😆

atcodedog05
22 - Nova
22 - Nova

Amazing job @Qiu 😎👍

Qiu
21 - Polaris
21 - Polaris

@Chelseaa 

Very glad to help.

Labels
Top Solution Authors