Can someone explain this?
| dt= | newtable("test", Add Rows( 8 ), |
| New Column( "A",Character,Nominal,Set Selected, |
| | Set Values({"apple", "apple", "apple", "apple", "pear", "pear", "pear", "pear"}) |
| ), |
| New Column( "B",Character,Nominal, |
| | Set Values({"red", "green", "red", "yellow", "yellow", "yellow", "pink", "pink"}) |
| ) |
);
//first way - this summarizes everything, not just apple rows
dtsummary1=dt<<summary(group(:B),where(:A=="apple"));
//second way - this summarizes only apple rows like I wanted
currentdatatable(dt);
dtsummary2=summary(group(:B),where(:A=="apple"));
I can just use the second way but I don't understand this behavior. Why doesn't Where work the same? Is there some smarter way to get the B values for just apple rows?