cancel
Showing results for 
Search instead for 
Did you mean: 

Concatenate two symbol lists - some values clobbered.

Krishna
New Contributor
Hello, 
I have :
q) a:td[`event_id]
q)a
`1593842`2265436`2884843`2563908`870084`1387664`880653`339905`852016`2156427`649825`1642323`358028`62304`3133271`1516..

q)b:diffsample[`event_id]
q)b
`344`266`566`114`473`564`195`273`347`81`98`390`285`571`269`8`414`107`142`26`581`514`342`475`446`288`140`328`516`396`2..

q)sum a in b
0i
q)where a in b
`long$()

Just to make sure: 
q)sum b in a   
0i             
q)where b in a 
`long$() 

q)count a
50703
q)count b
633

And now, when I do:
q)count distinct (a,b)
51082
q)count (a,b)
51336

why do the (51336-51082) values get clobbered? I checked in the respective tables, all rows containing the missing event_ids are pristine. 

Thanks, 
Kumar



      
            

3 REPLIES 3

Krishna
New Contributor
Also, please note that 
count(a,b) is the correct value I want(50703+633), however, the count distinct count(a,b) returns a value less that that sum, meaning it picks up some duplicates. 
However, (a in b) and (b in a) are null sets. 
Kumar

pressjonny0
New Contributor
It could be that a and b themselves have duplicates?

What is 

count[distinct a] + count distinct b

?

Thanks

Jonny

Sent from my iPhone

Yes, you're right, Jonny, thanks for that. My oversight. 
Much appreciated, 
Kumar