I wonder if this is a bug in the interaction between Dataset and Map:
ds = Dataset[{<|"Key" -> "A", "Value" -> 1|>, <|"Key" -> "A",
"Value" -> 2|>, <|"Key" -> "B", "Value" -> 10|>, <|"Key" -> "B",
"Value" -> 11|>}];
ds[Select[#"Key" == "A" &]]
uniqueKeys = {"A", "B"};
ds[Select[#"Key" == uniqueKeys[[2]] &]]
ds[Select[#"Key" == # &]] & /@ uniqueKeys
If I run this code, the first ds[Select[ statement returns 2 rows, as I would expect.
The second ds[Select[ statement likewise returns 2 rows.
The final statement, using Map, produces two empty Dataset[] object: 2 levels, but 0 rows in both cases.
Am I doing something wrong? (Wouldn't be the first time....)