So I have a file that has the following data:
User,
Session
What I want to happen is I want to list a user and then for each of the three sessions have a "Y" or "N" if they attended. So something like this:
User
Session 1
Session 2
Session 3
Harry Crumb
Y
N
Y
I have tried this code, however I am getting three separate lines generated. So I am trying to figure out how to put everything on the 1 line.
CASE
when Session in ('Session_1') then ('Y)
else ('N')
end as Session_1,
CASE
when Session in ('Wave_2') then ('Y')
else ('N')
end as WAVE_2,
CASE
when Session in ('Session_3') then ('Y')
else ('N')
end as Session_3
I was trying to search for the answer, but I am not sure what this type of syntax is called.
... View more