Requesting help with data transformation in Metabase

I have the following dataset within Metabase:

Responses

Requesting help to transform the data in such a way that all the responses by the same patient id and appointment id are in the same row.

Like this:

Transformed Responses

Any help will be highly appreciated.

Thank You.

You will need to do a group by and then do some kind of aggregate like max/min if the data is always gonna be empty

I would do it, @TonyC said.

I believed the best way.

@TonyC & @bjg thank you for your reply.

I have tried group by and these columns contains text value hence min max doesn't work.

I was expecting group by will group the appointment ID together however it's not working that way.

Min and Max should work on string columns ... What DB are you using? ... What result are you getting when doing so? Share some screenshots please