I am sure there is a better way, but the following does the job:
comps = exampleData[Union, "CompanyName"];
dummies = "dummy" <> ToUpperCase[#] & /@ comps;
funcs = Function[{x, y}, x -> (If[# == y, 1, 0] &)] @@@ Thread[Normal /@ {dummies, comps}];
ds2 = exampleData[All, Key["CompanyName"] /*Association[funcs]];
Dataset[Join @@@ Thread[Normal /@ {exampleData, ds2}]]
Alternatively you can use Boole
instead of If
to define funcs
:
funcs= Function[{x, y}, x -> (Boole[# == y] &)] @@@ Thread[Normal /@ {dummies, comps}];