Tables/Summary can count for you. To make it count over multiple columns, you have to fist stack the data:
dt = New Table( "test",
Add Rows( 6 ),
New Column( "W8",Set Values( [2, 5, ., 5, ., 6] )),
New Column( "W9",Set Values( [2, ., 3, 3, 1, 2] )),
New Column( "W1",Set Values( [2, ., ., ., ., .] )),
New Column( "W2",Set Values( [3, ., ., ., ., .] )),
New Column( "W3",Set Values( [3, ., ., ., ., .] )),
New Column( "W4",Set Values( [., ., 4, ., 2, .] )),
New Column( "W5",Set Values( [., 2, ., ., ., .] )),
New Column( "W6",Set Values( [., ., 5, ., 3, .] )));
dt << New Column( "row",Formula( Row() ));
dtstack =dt << Stack( columns( :W8, :W9, :W1, :W2, :W3, :W4, :W5, :W6 ),"Non-stacked columns"n( Keep( :row ) ));
dtstack << Summary( Group( :row ), N( :Data ) );
btw:
"Non-stacked columns"n
a named argument which needs to be written as "..."n. Argh!
How good that enhanced log knows these details ...