Dataset query for keys of upper levels
Association @@ (KeyValueMap[# -> {#2, #}&] @ dat) // Normal
<|"a" -> {2, "a"}, "b" -> {"y", "b"}, "c" -> {{2, 3}, "c"}|>
Using MapIndexed
:
MapIndexed[{#, #2[[1, 1]]} &, dat] // Normal
(* <|"a" -> {2, "a"}, "b" -> {"y", "b"}, "c" -> {{2, 3}, "c"}|> *)
Another possibility is:
dat[{Keys, {Values,Keys} /* Thread} /* Apply[AssociationThread]] //Normal
<|"a" -> {2, "a"}, "b" -> {"y", "b"}, "c" -> {{2, 3}, "c"}|>