Groups
Groups
Sign in
Groups
Groups
Kdb+ Personal Developers
Conversations
About
Send feedback
Help
How to rename the column name of a table according to a variable
1,644 views
Skip to first unread message
Wind
unread,
Mar 5, 2009, 2:39:29 AM
3/5/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Kdb+ Personal Developers
We could change col names with xcol:
q)cols b
`sym`date`close
q)b:`sym`date`ibm.close xcol b
q)cols b
`sym`date`ibm.close
The questions are as following:
1. could we change the col names according to a variable? such as :
q)x:`GOOG
q)`sym`date`$(string x) xcol b
'nyi
2. whether xcol is the efficient method changing name of columns.
Thanks.
Charlie Skelton,Kx
unread,
Mar 5, 2009, 3:18:07 AM
3/5/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to personal...@googlegroups.com
yes
q)(`sym`date,`$string x) xcol b
xcol is very efficient
Attila Vrabecz
unread,
Mar 5, 2009, 3:35:13 AM
3/5/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to personal...@googlegroups.com
(`sym`date,x) xcol b
is enough if x is already a symbol
Attila
Wind
unread,
Mar 5, 2009, 4:55:11 AM
3/5/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Kdb+ Personal Developers
Great. That works well.
Thanks Attila
Wind
On Mar 5, 4:35 pm, Attila Vrabecz <
attila.vrab...@gmail.com
> wrote:
> (`sym`date,x) xcol b
> is enough if x is already a symbol
> Attila
>
> On Thu, Mar 5, 2009 at 8:18 AM, Charlie Skelton,Kx <
char...@kx.com
> wrote:
> > yes
> > q)(`sym`date,`$string x) xcol b
>
> > xcol is very efficient
Reply all
Reply to author
Forward
0 new messages