I have the below table
t:flip (`comps`uid)!(("ub01,140,16600,1|msil,140,31,0|gsc,140,40,0|csf,140,9,1|ci,140,18,1|in,140,10,1|j106,100,100,1";"ub01,140,16600,1|msil,140,31,0|gsc,140,40,0|csf,140,9,1|ci,140,18,1|in,140,10,1|j106,100,100,1");`user1`user2)
I am trying to populate the valueWhere1
and valueWhere0
columns from the below table
tRes:flip (`comps`uid`valueWhere1`valueWhere0)!(("ub01,140,16600,1|msil,140,31,0|gsc,140,40,0|csf,140,9,1|ci,140,18,1|in,140,10,1|j106,100,100,1";"ub01,140,16600,1|msil,140,31,0|gsc,140,40,0|csf,140,9,1|ci,140,18,1|in,140,10,1|j106,100,100,1");`user1`user2;(`ub01`csf`ci`in`j106;`ub01`csf`ci`in`j106);(`msil`gsc;`msil`gsc))
I have got the count of each string where the value before each pipe is either 1,0
t:update countWhere1:sum each {"1"=last x}''["|"vs'comps],countWhere0:sum each {"0"=last x}''["|"vs'comps] from t
Trying to pull in the first section of each string and filter based on the 1;0 flag. I have the below but not quite working
`$first each raze {"," vs x} each '{"|"vs x} each ("ub01,140,16600,1|msil,140,31,0|gsc,140,40,0|csf,140,9,1|ci,140,18,1|in,140,10,1|j106,100,100,1";"ub01,140,16600,1|msil,140,31,0|gsc,140,40,0|csf,140,9,1|ci,140,18,1|in,140,10,1|j106,100,100,1")
Thanks for looking