11-30-2014 05:21 AM
Is it possible to make a SAS code to lookup if a customer have bought from multiple channels.
|Order_ID||Customer name||Regular shop||Web-shop|
Therefore, I want to check it if a customer (by Email), at any given time, has bought in the web-shop, also bought in the regular shop.
If this is the case. this customer should have a "1" in a new column.
In the above mentioned example James would get a 1 in the new column because he bought in both shops.
I hope you guys can help me.
11-30-2014 08:59 AM
create table want as
select a.*,b.new_var from have a
(select Customer_name, Email, case when sum(Regularshop)=1 and sum(Webshop)=1 then 1 else 0
end as new_var
group by Customer_name, Email) b
Need further help from the community? Please ask a new question.