Important Community update: The process for changing your account details was updated on June 25th. Learn how this impacts your Community experience and the actions we suggest you take to secure your account here.

Alteryx Designer Desktop Discussions

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

SWAP COLUMN NAMES BASED ON BELOW DATES

Ramcharan99
7 - Meteor

I want to swap column name based on dates MAX (END_DT,ENRL_THRU_DT) Should have starting with prefix ML_

and MIN (END_DT,ENRL_THRU_DT) Should have starting with prefix RI_ below are examples 

 

Appreciated for immediate solutions

 

Input :

ID

NAME

START_DT

END_DT

ENRL_FROM_DT

ENRL_THRU_DT

1

A

01-06-2022

01-05-2022

01-06-2022

01-05-2022

2

B

01-09-2022

01-10-2022

01-09-2022

01-12-2022

3

C

01-03-2022

01-07-2022

01-03-2022

01-12-2022

1

A

01-06-2022

01-12-2022

01-06-2022

01-12-2022

2

B

01-09-2022

01-12-2022

01-09-2022

01-12-2022

3

C

01-03-2022

01-12-2022

01-03-2022

01-12-2022

 

Output :

 

RI_ID

RI_NAME

RI_START_DT

RI_END_DT

RI_ENRL_FROM_DT

RI_ENRL_THRU_DT

ML_ID

ML_NAME

ML_START_DT

ML_END_DT

ML_ENRL_FROM_DT

ML_ENRL_THRU_DT

1

A

01-06-2022

01-05-2022

01-06-2022

01-05-2022

1

A

01-06-2022

01-12-2022

01-06-2022

01-12-2022

2

B

01-09-2022

01-10-2022

01-09-2022

01-12-2022

2

B

01-09-2022

01-12-2022

01-09-2022

01-12-2022

3

C

01-03-2022

01-07-2022

01-03-2022

01-12-2022

3

C

01-03-2022

01-12-2022

01-03-2022

01-12-2022

3 REPLIES 3
ShankerV
17 - Castor

Hi @Ramcharan99 

 

One way of doing this.

 

ShankerV_0-1676380471237.png

 

Many thanks

Shanker V

ShankerV
17 - Castor

Hi @Ramcharan99 

 

Added the below Multi Field Formula to change the date to input data format.

 

ShankerV_0-1676380735088.png

 

Many thanks

Shanker V

Ramcharan99
7 - Meteor

Hi Shanker V,

 

Can you check below data use NEW_IND and get an out like below 

 

Input :

IDNAMESTART_DTEND_DTENRL_FROM_DTENRL_THRU_DTNEW_IND
1A01-06-202201-05-202201-06-202201-05-2022Y
2B01-09-202201-10-202201-09-202201-12-2022Y
3C01-03-202201-07-202201-03-202201-12-2022Y
1A01-06-202201-12-202201-06-202201-12-2022N
2B01-09-202201-12-202201-09-202201-12-2022N
3C01-03-202201-12-202201-03-202201-12-2022N
4D01-01-202201-05-202201-01-202201-05-2022N
4D01-09-202201-10-202201-09-202201-10-2022Y
4D01-01-202201-05-202201-01-202201-05-2022N
5E01-04-202201-05-202201-04-202201-05-2022Y
5E01-09-202231-12-202201-09-202231-12-2022Y
6F01-06-202201-12-202201-06-202201-12-2022Y

 

Output :

RI_IDRI_NAMERI_START_DTRI_END_DTRI_ENRL_FROM_DTRI_ENRL_THRU_DTRI_NEW_INDML_IDML_NAMEML_START_DTML_END_DTML_ENRL_FROM_DTML_ENRL_THRU_DTML_NEW_IND
1A01-06-202201-05-202201-06-202201-05-2022Y1A01-06-202201-12-202201-06-202201-12-2022N
2B01-09-202201-10-202201-09-202201-12-2022Y2B01-09-202201-12-202201-09-202201-12-2022N
3C01-03-202201-07-202201-03-202201-12-2022Y3C01-03-202201-12-202201-03-202201-12-2022N
4D01-01-202201-05-202201-01-202201-05-2022N4D01-01-202201-05-202201-01-202201-05-2022N
5E01-04-202201-05-202201-04-202201-05-2022Y5E01-09-202231-12-202201-09-202231-12-2022Y
nullnullnullnullnullnullnull6F01-06-202201-12-202201-06-202201-12-2022Y
Labels