is it possible to change multiple field values when using CASE statement?
I have a Text field with several values ( 5 differnt ones) and each of this value has its own Boolean field in tragt Data Extension.
Is there a way to combine those CASE statements? I dont get it working.
I used this as a basis:
SELECT
Key,
, case
when Source in ('Web') then 1
else 0
end As Source_Web
, case
when Source in ('facebook') then 1
else 0
end As Source_facebook
FROM [Old_DE]
This would continue until all Values are fetched but it is not working. Anyone able to help out?
UPDATE
Let me elaborate more on it:
OLD DE:
Key, Country, Source
123456,SW,Phone
123456,US,Web
123456,IT,Phone
123456,Clara,facbook
New Data Extension has structure below (source fields are boolean fields and should updated to true(
Outcome of the query should look like:
Key,Source_Phone,Source_Web,Source_facebook
123456,1,1,1
hope that makes my problem more clear
case when x = 1 then a when y=1 then b.... end as value
or will each output 5 different values depending on the 5 different fields (like in your example with phone and personal)?