Alteryx Designer Desktop Discussions

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

Add a column for an end date in MultiRow Tool

alphabex18
8 - Asteroid

Hi all, 

 

I want to create a new column called "PlanEndDate" in this workflow. Below are my fields. the EEPID field is unique, and repeats for every time a plan is changed. The PlanEffectiveDateHistory Field is the "start date" of that plan, but i need to calculate the end date. I cant get my if statment to work correctly in my MultiRow tool. Here is what I want to accomplish in that tool

IF ([Row+1:EEPID] = [EEPID] then Row+1 PlanEffeftiveDateHistory minus one day. If the EEPID row is the last one then it would populate with the last day of the current month or something that would indicate that the plan is active and has not ended. This would be a date field, so putting "current" in the field probably wouldn't work

for example records 1-4 is the same person, and here is the desired outcome for the new field

RecordEEPIDEmployeeEnrollmentDatePlanEffDateHistoryPlanEndDate
101005.087.M2006-04-012006-04-012009-03-31
201005.087.M2006-04-012009-04-012014-11-30
301005.087.M2006-04-012014-12-012017-11-30
401005.087.M2006-04-012017-12-01current plan or some kind of date that could always indicate that its a current plan. maybe 2222-01-01

 

Here is my sample data

 

Plan End.jpg

 

 

 

5 REPLIES 5
carlosteixeira
15 - Aurora
15 - Aurora

Hi @alphabex18 

 

Try use this workflow adpting to your necessary. If not work or you can´t understand, let me know and send your source and so that I can ride for you.

 

Holpe this help you.

 

Best regards

Carlos A Teixeira
alphabex18
8 - Asteroid

its helpful for sure but I think my iif statement is malformed, and i dont know how to get it right. This is what i have...

 

iif([Row+1:EEPID]=[EEPID], DateTimeAdd([Row+1:PlanEffectiveDateHistory],-1,"days")

carlosteixeira
15 - Aurora
15 - Aurora

Can you put here your workflow?

 

This way my help will be more efective! :-)

 

Carlos A Teixeira
alphabex18
8 - Asteroid

Nevermind. I got it. it was actually much easier than I first thought

Here is the final result for anyone else that comes across this problem....

 

 

IF [Row+1:EEPID] = [EEPID] THEN DateTimeAdd([Row+1:PlanEffectiveDateHistory],-1,"days") ELSE "2222-12-02" ENDIF

 

 

carlosteixeira
15 - Aurora
15 - Aurora

Good Job my friend,

 

If you need more help dont hesitate let me know.

 

Best Regards

Carlos A Teixeira
Labels