Re: [personal kdb+] Elementary loading

it looks like you’re calling get from the command prompt, not from within q 

within q your file specification is correct, and you’d use 0:

 C:\q>type data.csv

ll,f0,f1

111,222.2,333.3

1234,56.7,8.9

C:\q>q

KDB+ 3.1T 2013.04.03 Copyright (C) 1993-2013 Kx Systems

w64/ 1()core 1023MB Simon simon-w8 192.168.116.137 EXPIRE ..

q)(“JFF”;enlist",")0:`:c:/q/data.csv

ll   f0    f1


111  222.2 333.3

1234 56.7  8.9

q)

see:

http://code.kx.com/wiki/Reference/ZeroColon

When I do the steps you show I get:

C:\q>w32\q
KDB+ 3.0 2012.12.22 Copyright (C) 1993-2012 Kx Systems
w32/ 8()core 4095MB Ray antec-pc 192.168.1.107? 2013.03.22

'exp

C:\q>q
‘q’ is not recognized as an internal or external command,
operable program or batch file.

'exp - that trial release has expired. Please download the latest from

http://kx.com/software-download.php

thanks

Thanks for your assistance that worked; I am obviously new at this. 

I saved my table splayed with no problem but then keyed it on the long. Using set on that causes an error. Is there special syntax for storing keyed tables?

Hi Ray,

You can’t save keyed tables as splayed, this is one of the limitations of splayed tables.

http://code.kx.com/wiki/JB:KdbplusForMortals/splayed_tables#1.2.0.2_Limitations_of_Splaying

Perhaps you might consider using a linked column, more information can be found here.

http://code.kx.com/wiki/JB:KdbplusForMortals/splayed_tables#1.2.8_Links_between_Splayed_Tables

http://code.kx.com/wiki/Cookbook/LinkingColumns#Splayed_Tables

Regards,

Paul

could also re-apply the key on the fly when mapping the splayed table
e.g.

q)t1:ab xkey select a,b,c from get`:t/

My work table will require 53gig. How do I build it directly to disk?

you can append to splayed tables using upsert

e.g.

`:splay/ upsert newData

Thanks for all your help.
I do not see in qfm or the wiki instructions for self or Cartesian joins or table aliasing. I attempted to use a view for this but did not succeed. In a self join, how can you refer to the identical columns in each joined table?

q)t:( c:1 2 3; x:100 200 300;y:1000 2000 3000)
q)v::select c, x, y from t
q)t
c x?? y

1 100 1000
2 200 2000
3 300 3000
q)v
c x?? y

1 100 1000
2 200 2000
3 300 3000
q)select from t, v
c x?? y

1 100 1000
2 200 2000
3 300 3000
1 100 1000
2 200 2000
3 300 3000
q)select t.c, v.c from t, v
'type

there’s an easily overlooked page on code.kx.com which summarizes the available joins in kdb+

http://code.kx.com/wiki/Reference/joins

Thanks for the reference. I was following the joins section in qfm and saw most of those, but as I understand the references none seems to supply the equivalent of a SQL Cartesian join. I’d expect 9 rows to result from a self join on my example table t.

Cartesian join: www.timestored.com/kdb-guides/qsql-inner-left-joins#nonstandard-sql-inner-join
Use xgroup to group all next lists for each key.

On 4/14/2013 4:57 PM, Ray wrote:

Thanks for the reference. I was following the joins section in qfm and saw most of those, but as I understand the references none seems to supply the equivalent of a SQL Cartesian join. I'd expect 9 rows to result from a self join on my example table t.

On Apr 14, 2013, at 10:14 AM, Charles Skelton <charlie@kx.com> wrote:

there’s an easily overlooked page on code.kx.com which summarizes the available joins in kdb+

http://code.kx.com/wiki/Reference/joins

also have a look at cross

e.g.

q)(date:2001.01.01+til 3)cross(time:10:00 11:00)

date       time 


2001.01.01 10:00

2001.01.01 11:00

2001.01.02 10:00

2001.01.02 11:00

2001.01.03 10:00

2001.01.03 11:00

perfect, thanks so much!