Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Based on the Flag active status we need to fill the appropriate description columns like the below given output. It’s like transpose of rows to column based on a key value.
For example
Input file:
|
Id |
Flag1 |
Flag2 |
Flag1_desc1 |
Falg1_desc2 |
Flag2_desc1 |
Flag2_desc2 |
|
1 |
1 |
0 |
abc |
abc |
|
|
|
2 |
0 |
1 |
|
|
abc |
abc |
|
3 |
1 |
1 |
abc |
abc |
abc |
abc |
Output:
|
Id |
Flag |
Desc1 |
Desc2 |
|
1 |
Flag 1 |
abc |
abc |
|
2 |
Flag2 |
abc |
abc |
|
3 |
Flag1 |
abc |
abc |
|
3 |
Flag2 |
abc |
abc |
Thanks in advance
hi manohar,
Thanks for your reply but actually it is not transpose of rows to column some logic is there can you please help me out
@saravanan_ehkn ,check the below solution.