Here is one possible way to do this. What I do is 1) reshape the data from wide to long, and then 2) make indicator variables for in and out, then 3) aggregate by summing those indicator variables.
*******************************************.
SPSSINC GETURI DATA
URI="
http://spssx-discussion.1045642.n5.nabble.com/file/n5729790/Switching_data.xlsx"
FILETYPE=XLSX DATASET=Data
/OPTIONS SHEETNAME="Data" READNAMES=YES ASSUMEDSTRWIDTH=32767.
*1 reshape.
VARSTOCASES /MAKE Brand FROM In Out /INDEX Type.
*2 indicator variables.
COMPUTE In = (Type = 1).
COMPUTE Out = (Type = 2).
*3 aggregate.
DATASET DECLARE TableOutput.
AGGREGATE OUTFILE='TableOutput'
/BREAK Brand
/In = SUM(In)
/Out = SUM(Out).
DATASET ACTIVATE TableOutput.
COMPUTE Net = In - Out.
*******************************************.