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 |
Solved! Go to Solution.
Hi @akumar2609
Tried with a different data set 2 where the condition will not meet.
Dataset2:
Output:
Many thanks
Shanker V
It worked for me. Thank you so much.
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 |
Hi @akumar2609
Could you please share input and the expected output.
Will amend the workflow to handle duplicates too.
Many thanks
Shanker V
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 |