Try adding AsColumn() around your hides[i].
Not directly related to this, but if you have JMP16+ it is usually better to use For Each instead of For
Names Default To Here(1);
dt = New Table("Untitled",
Add Rows(4),
Compress File When Saved(1),
New Column("Column 1", Character, "Nominal", Set Values({"a", "", "a", ""})),
New Column("Column 2", Character, "Nominal", Set Values({"", "b", "b", ""}))
);
cols = {:Column 1, :Column 2};
For Each({cur_col}, cols, // if you have JMP16+ usually better to use For Each than for
dt << Select Where(cur_col != "") << Hide and Exclude(1) << Clear Select
);
-Jarmo