Hello,After pivoting a table, I end up with something likeq)t:([a:x
yz]b:(1 2; 3 4; 5 6);c:(1 2;
int$();5 6))q)ta| b c-| -----------x| 1 2 1 2y| 3 4 int$()z| 5 6 5 6I would like to ungroup this, but I can't because of the empty list:q)ungroup tk){$[#x:0!x;,/+:'x;x]}'length@+:'+
ab
c!(x
yz;(1 2;3 4;5 6);(1 2;
int$();5 6))Is there any easy way to replace the empty list with a list of nulls ofthe appropriate length so that I can produce the following?a b c------x 1 1x 2 2y 3 0ny 4 0nz 5 5z 6 6Thanks,Josh
find null lists, and then amend the column would work
ungroup update c:@[c;where null first each c;:;0N] from t
Following ensures each cell in the table is of the same length as the max length of any cell in that row:
q)ungroup{(max each count’‘)#’'x}t
a b c
-------
x 1 1
x 2 2
y 3 0Ni
y 4 0Ni
z 5 5
z 6 6
Mohammad Noor