Re: Re: [personal kdb+] dictionary with flip

To put it simple: flip needs an input that is at least two dimensional and rectangular.
So, a simple dict can’t be flipped unless the values are lists of the same length or dicts of the same keys. In your case flip didn’t work, because your dict was only one dimensional.

Some examples:

q) flip (1 2;3 4)

q) flip xy!(1 2;3 4)

q) flip (ab!1 2;ab!3 4)

q) flip xy!(ab!1 2;ab!3 4)

As a special case, flip also works if some of the values of the dict or list are atoms.

q) flip (1 2;3)

q) flip ab!(1 2;3)

q) (a:1 2;b:3)

The table syntax is equivalent to the flipped dict syntax:

q) parse[“flip ab!(1 2;3)”] ~ parse"(a:1 2;b:3)"

1b

Regards,

András