Depending on your data and the speed you need, you might want to change how you get the list of unique values, but below is one option
Names Default To Here(1);
dt = New Table("Untitled 4",
Add Rows(3),
Compress File When Saved(1),
New Column("Column 1", Character, "Nominal", Set Values({"dne", "**skipped**", "**skipped**"})),
New Column("Column 2", Character, "Nominal", Set Values({"dne", "a", "b"})),
New Column("Column 3", Character, "Nominal", Set Values({"**skipped**", "c", "d"})),
New Column("Column 4", Character, "Nominal", Set Values({"dne", "dne", "**skipped**"}))
);
aa_colmask = ["dne" => 1, "**skipped**" => 1]; // we don't need the values, just keys
cols_to_remove = {};
For Each({colname}, dt << Get Column Names("String"),
// depending on how much data you have, you might want to use different unique value techniques
// Summarize, Associative Array and Summary are few options.
// You can also first check if there are exactly 2 unique values, then check those
aa_values = Associative Array(Column(dt, colname)); // I use AA here as it is the easiest option (not fastest!)
aa_values << Remove(aa_colmask);
If(N Items(aa_values) == 0,
Insert Into(cols_to_remove, colname);
);
);
dt << Delete Columns(cols_to_remove);
-Jarmo