Yes, for this specific scenario it would be best to create a custom stored procedure to accomplish your purposes. Because in Denodo, it is not possible to dynamically transpose rows to columns in this way. For an overview of custom stored procedures please check out the [Developing Stored Procedures](https://community.denodo.com/docs/html/browse/latest/en/vdp/developer/developing_extensions/developing_stored_procedures/developing_stored_procedures) section of Virtual DataPort Developer Guide.
If you have a valid support user account, please open a new support case at support.denodo.com so that the support team can review the question in detail.
Hope this helps!