In a table transformer, how do I transpose data elements from a source table into columns of the same name? Possibly the column names may need to be set statically, rather than dynamically - but I prefer the latter!
The source table will look like this. Some extra columns have been removed, just to keep the example cleaner and easier.
Source table:
Date | Product | Category | Current |
28/11/2023 | Hybrid | Releasability | C |
28/11/2023 | Hybrid | Reliability | B |
28/11/2023 | Hybrid | Security Vulnerabilities | C |
28/11/2023 | Hybrid | Security Review | D |
28/11/2023 | Hybrid | Maintainability | A |
28/11/2023 | Cloud | Releasability | A |
28/11/2023 | Cloud | Reliability | A |
28/11/2023 | Cloud | Security Vulnerabilities | A |
28/11/2023 | Cloud | Security Review | A |
28/11/2023 | Cloud | Maintainability | A |
14/11/2023 | Hybrid | Releasability | C |
14/11/2023 | Hybrid | Reliability | B |
14/11/2023 | Hybrid | Security Vulnerabilities | C |
14/11/2023 | Hybrid | Security Review | D |
14/11/2023 | Hybrid | Maintainability | A |
14/11/2023 | Cloud | Releasability | A |
14/11/2023 | Cloud | Reliability | A |
14/11/2023 | Cloud | Security Vulnerabilities | A |
14/11/2023 | Cloud | Security Review | A |
14/11/2023 | Cloud | Maintainability | A |
I want one of the tables to filter by 'Product' = "Hybrid", with a row per date and the columns generated from the data in the 'Category' field.
Output table for 'Hybrid'
Date | Releasability | Reliability | Security Vulnerabilities | Security Review | Maintainability |
28 Nov 2023 | C | B | C | D | A |
14 Nov 2023 | C | B | C | D | A |
And I want to be able to have a different transformation to filter by 'Product' = "Cloud", but in the same structure as mentioned above.
Output table for 'Cloud'.
Date | Releasability | Reliability | Security Vulnerabilities | Security Review | Maintainability |
28 Nov 2023 | A | A | A | A | A |
14 Nov 2023 | A | A | A | A | A |
I don't think the transpose function does this in the table transformer macro, so what is the clever SQL which will do this for me?