Hi Community,
I have a problem statement and thinking how can I use SQL Table Transformer Macro for Confluence.
1. I have three tables coming from three different excerpt include with same columns (some are date column, some text field, some status column).
2. I would want to build 4th table with selected columns and some column to have merged information from three tables -
How can I write query based on Project code (unique field, present on all three tables) to fetch columns like Project Name, Porject Code, Project Status (status field), Highlights, upcoming release - stressing that those three tables are 3 domains for a Project so 4th table will have merged information for highlights and next steps and Status will be Green if all are Green AND Yellow if one of them is Yellow AND RED if one of them is RED.
If one PR# is just present in one table, bring the same information without any transformation.
| Domain 1 table | | | | | Domain 2 table | | | | |
| PR# | Highlights | Next Steps | Status | | PR# | Highlights | Next Steps | Status | |
| PR101 | xx | yy | Green | | PR101 | ii | ll | Green | |
| PR102 | AA | BB | Yellow | | PR102 | mm | nn | Yellow | |
| PR105 | DD | EE | Green | | PR108 | VV | ZZ | Green | |
| | GG | PP | Green | | PR109 | MN | JK | Green | |
| Domain 3 table | | | | | Expected Transformed table | | | | |
| PR# | Highlights | Next Steps | Status | | PR# | Highlights | Next Steps | Status | |
| PR101 | pp | qq | Green | | PR101 | xx ii pp | yy ll qq | Green | |
| PR102 | ww | gg | Green | | PR102 | AA mm ww | BB nn gg | Yellow | |
| PR109 | VV | ZZ | | | PR108 | VV | ZZ | Green | |
| PR110 | WE | WE | | | PR105 | DD | EE | Green | |
| | | | | | PR109 | VV | ZZ | Green | |
| | | | | | PR110 | WE | WE | | |