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

Looks like you have some sort of relationship between an appointment table and a question table.
Instead of joining them as appointment to question, create some views that only include one question type each.
Then you have a nice star schema with appointment as the fact table and a separate dimension for each question.
Much easier to work with.

Hello All,

@AndrewMBaines , @TonyC , @bjg the issue has been resolved. I followed what Andrew suggested and created table for 1 question type each and then built a data model by joining each question separately.

Thank you for all the help provided. Much appreciated.

1 Like