Sam11
October 10, 2012, 3:15am
1
Hi,
I am trying to join 2 columns columnwise. I tried to do the following but it returns a list of varchar. How do I convert it into a single string. If this is not possible, any other suggestions?
thanks.
q)t:( b:s
ga
sa;c:30 10 43 13 24;g:
ssgg
aass
aa)
q)t
b c g
s 30 ss
g 10 gg
a 43 aa
s 13 ss
a 24 aa
q)
q)p:select BG:(b,'g) from t
BG
s ss
g gg
a aa
s ss
a aa
q)meta p
c | t f a
–| -----
BG| S
Hi Sam,
Is this what you are looking for…
q)t:( b:s
ga
sa;c:30 10 43 13 24;g:
ssgg
aass
aa)
q)t
b c ?g
s 30 ss
g 10 gg
a 43 aa
s 13 ss
a 24 aa
q)select BG:((string b),'string g) from t
BG
“sss”
“ggg”
“aaa”
“sss”
“aaa”
q)meta select BG:((string b),'string g) from t
c | t f a
–| -----
BG| C
Thanks Rory
Sam11
October 10, 2012, 4:49am
3
Yes Thank you. I was trying so many things and got confused. Thanks for your help.
Sam11
October 10, 2012, 4:53am
4
Hi Rory,
Do you know how to put a hyphen (-) between the combined columns? So the resulting merged column looks like this -
BG
“s-ss”
“g-gg”
..
thanks
Sam
This will help
Select BG:((string b), ‘(“-”,’ string g)), from t