I have a data set where it goes something similar to this:
name measure status
john doe blood pressure iscompliant
john doe Hba1c notcompliant
jane doe BMI iscompliant
jane doe blood pressure notcompliant
I will have an unknown amount of measures to work with, so if there's a way to do this dynamically, that would be awesome. I'm looking for a result set like this:
name blood pressure Hba1c BMI
john doe iscompliant notcompliant null
jane doe notcompliant null iscompliant
I couldn't find any examples that were able to tie two columns together like in my example with status and measure. I'm not sure if if I need to cross apply my data then pivot, or if I can pivot straight away. Any help is appreciated, thank you for your time.
edit: i am using sql server 2014