Add supporting prints inside your for loop to see what is going on with the one specific column. I usually like using Show()
Names Default To Here(1);
dt = {};
dt_u = New Table("Untitled",
Add Rows(3),
New Column("Column 1", Character, "Nominal", Set Values({"N/A", "N/A", "N/A"})),
New Column("Column 2", Character, "Nominal", Set Values({"a", "", ""})),
New Column("Column 3", Character, "Nominal", Set Values({"b", "", ""})),
New Column("Column 4", Character, "Nominal", Set Values({"N/A", "N/A", ""}))
);
dt[1] = dt_u << get name;
d = 1;
For(i = N Cols(Datatable(dt[d])), i >= 1, i--,
Summarize(Data Table(dt[d]), temp = by(Column(i)));
If(i == 3,
show(temp);
);
If(N Items(temp) == 1 & temp[1] == "N/A",
show(temp);
Data Table(dt[d]) << delete columns(Column(i))
);
);
-Jarmo