I have a table like this:
nameTable
| Name | Included |
|---|---|
| Ann | 1 |
| Bob | 0 |
| Cat | 1 |
I have a function that gets the "bits" from the Included? column:
// get the bits
fGetBits:{[nameTable]
nameTable: select Included from nameTable;
//BitsTable
value flip nameTable}
This returns the following, of type 0h:
1 0 1
My question is how can I then take this 0h list and add it back to the Included column of the nameTable table, replacing the current values?
So for example, if I had the following:
0 1 1
I want my table to now look like this:
| Name | Included |
|---|---|
| Ann | 0 |
| Bob | 1 |
| Cat | 1 |
Thanks for the help.
>Solution :
Also worth mentioning a simple update statement https://code.kx.com/q/ref/update/
q)update Included:011b from([] Name:`Ann`Bob`Cat;Included:101b)
Name Included
-------------
Ann 0
Bob 1
Cat 1