Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

Combining two different data set on condition in alteryx

akumar2609
8 - Asteroid

I need help to combine two different data set based on the condition.
I have two data set

Data set 1

 

 

 

 

Scenario

Q1

Q2

Q3

Q4

A

123

234

345

456

B

2876

9870

9754

953

C

9087

5432

9085

1234

D

908

124

876

457

 

Data set 2

 

 

 

 

Scenario

Q1

Q2

Q3

Q4

A

564

234

345

456

 

 

If in Scenario column, there is "A", then combine both the data set and incase not then just give me the data set 1 in the output.

 

If Condition met, then

 

 

 

 

Scenario

Q1

Q2

Q3

Q4

A

123

234

345

456

B

2876

9870

9754

953

C

9087

5432

9085

1234

D

908

124

876

457

A

564

234

345

456

 

If Condition not met, then

 

 

 

 

Scenario

Q1

Q2

Q3

Q4

A

123

234

345

456

B

2876

9870

9754

953

C

9087

5432

9085

1234

D

908

124

876

457

6 REPLIES 6
ShankerV
17 - Castor

Hi @akumar2609 

 

One way of doing this.

 

ShankerV_0-1680791327841.png

 

 

Many thanks

Shanker V

ShankerV
17 - Castor

Hi @akumar2609 

 

Tried with a different data set 2 where the condition will not meet.

 

Dataset2:

ShankerV_0-1680791822210.png

 

Output:

 

ShankerV_1-1680791837456.png

 

Many thanks

Shanker V

akumar2609
8 - Asteroid

It worked for me. Thank you so much. 

akumar2609
8 - Asteroid

Hi 

 

The solution you provided worked only where there are only one scenario in first data set. If any scenario name gets repeated, data is getting duplicated.

 

Data set 1

 

 

 

 

Scenario

Q1

Q2

Q3

Q4

A

123

234

345

456

B

2876

9870

9754

953

C

9087

5432

9085

1234

C

980

456

124

098

A

905

3456

0981

907

D

908

124

876

457

  

ShankerV
17 - Castor

Hi @akumar2609 

 

Could you please share input and the expected output.

 

Will amend the workflow to handle duplicates too.

 

Many thanks

Shanker V

akumar2609
8 - Asteroid

I need help to combine two different data set based on the condition.


I have two data set

Data set 1

 

 

 

 

Scenario

Q1

Q2

Q3

Q4

A

123

234

345

456

B

2876

9870

9754

953

A

9087

5432

9085

1234

C

0987

5643

222

231

D

908

124

876

457

D

896

6754

4312

097

 

Data set 2

 

 

 

 

Scenario

Q1

Q2

Q3

Q4

A

564

234

345

456

 

 

If in Scenario column, there is "A", then combine both the data set and incase not then just give me the data set 1 in the output.

 

 

 

If Condition met, then

 

 

 

 

Scenario

Q1

Q2

Q3

Q4

A

123

234

345

456

B

2876

9870

9754

953

A

9087

5432

9085

1234

C

0987

5643

222

231

D

908

124

876

457

D

896

6754

4312

097

A

564

234

345

456

 

 

 

If Condition not met, then

 

 

 

 

Scenario

Q1

Q2

Q3

Q4

A

123

234

345

456

B

2876

9870

9754

953

A

9087

5432

9085

1234

C

0987

5643

222

231

D

908

124

876

457

D

896

6754

4312

097

 

Labels