I would like some help pivoting. I have a dataset in SQL that looks like this
ID-----------VisitDate----------Metric------Value 1001---------2012-01-01---------Cajun-------40 1001---------2012-01-02---------Cajun-------30 1001---------2012-01-01---------Ham---------20 1003---------2012-01-02---------Ham---------10 1003---------2012-01-03---------Beef--------10 How can I pivot this dataset so that I transform it from long to wide format based on the ID and VisitDate Columns, so the dataset would look something like this:
ID-----------VisitDate----------Cajun------Ham--------Beef 1001---------2012-01-01---------40---------20---------Null 1001---------2012-01-02---------30---------Null-------Null 1003---------2012-01-02---------Null-------10---------Null 1003---------2012-01-03---------Null-------Null-------10
Valueupfront?