Questions tagged [kdb]

kdb+ is a proprietary high-performance database developed by Kx Systems.

kdb+ is a proprietary high-performance database developed by KX.

Features

  • Scalable column-oriented database for massive data volumes
  • Manages real-time and historical data in one platform
  • A single system allowing for low latency communication between kdb+ processes
  • Coupled with the expressive q programming and query language

It comes with a programming language called q (or kdb/q). Both q and kdb are written in the k language which has the tag on this site.

More Information

KX have recently launched the KX Community, a site moderated daily by KX employees to ensure all questions are answered. For any questions, on q/kdb+ or any of the KX technology and products, our KX experts are on hand to help!

2014 questions
6
votes
2 answers

Optimize a query using select/fby twice in q kdb

I'm solving the classic problem of fby to find the max price per symbol from a trade table. table: tr time sym src price size ------------------------------------------------- 2019.03.11D09:00:00.277000000 GOOG L 36.01…
Utsav
  • 5,572
  • 2
  • 29
  • 43
6
votes
2 answers

kdb apply function in select by row

I have a table t: flip `S`V ! ((`$"|A|B|"; `$"|B|C|D|"; `$"|B|"); 1 2 3) and some dicts t1: 4 10 15 20 ! 1 2 3 5; t2: 4 10 15 20 ! 0.5 2 4 5; Now I need to add a column with values on the the substrings in S and the function below (which is a bit…
chrise
  • 4,039
  • 3
  • 39
  • 74
6
votes
3 answers

KDB + query - Implement Not like

I have to use not like operation in KDB + query but do not know how exactly to use it. I am able to use like operator i.e. http://kdbserver:8001/?select from orderDetails where symbol like "X*" this query successfully gives the results. How to…
cheers519
  • 445
  • 6
  • 18
6
votes
1 answer

q/kdb+ windows server setup

I'm trying to setup qStudio in windows. While adding a new server, an error message pops up, saying: Connection does not work.java.io.IOException: java.sql.SQLException: Connection refused: connect. Used default "Server Properties"…
user3712166
  • 61
  • 1
  • 4
6
votes
3 answers

KDB concatenating strings inside select/exec statements

I have a table T with column Sym:`IBM`MSFT`GOOG... Want the easiest way to create new column of the form newColumn: "IBM_Buy","MSFT_Buy","GOOG_Buy",... The following does NOT seem to do the trick: select ((string Sym),"_Buy") from T
bigO6377
  • 1,256
  • 3
  • 14
  • 28
6
votes
1 answer

How do I fix the q command prompt under cygwin, using mintty?

I find that when launching q from cygwin underneath mintty, the console generally seems to work, however the q) prompt is not displayed. I am just met with a blank line. I have the latest cygwin, and the latest mintty terminal. Note that when I…
pamphlet
  • 2,054
  • 1
  • 17
  • 27
6
votes
3 answers

How to apply max function for each row in KDB?

I want to ensure all values in column x are no smaller than 0.5, so I do: update x:max (x 0.5) from myTable But this gives an error (in Studio For KDB+): An error occurred during execution of the query. The server sent the response: type Studio…
mchen
  • 9,808
  • 17
  • 72
  • 125
6
votes
2 answers

kdb ticker plant: where to find documentation on .u.upd?

I am aware of this resource. But it does not spell out what parameters .u.upd takes and how to check if it worked. This statement executes without error, although it does not seem to do anything: .u.upd[`t;(`$"abc";1;2;3)] If I define the table…
user443854
  • 7,096
  • 13
  • 48
  • 63
6
votes
3 answers

How to get list of available functions and their parameters in KDB/Q?

How would I go about getting a list of available functions and their parameters in a given namespace?
J.P. Armstrong
  • 836
  • 1
  • 9
  • 26
6
votes
2 answers

Variable visibility when defining functions inside functions with q

I am defining a function that contains another function inside: find_badTicks:{ [tab;sec] // dummy function, for debug.. Ndays: 10i ; dates: select distinct date from tab where sym = sec ; closures: select last price by date from tab where sym…
Marco Mene
  • 397
  • 2
  • 6
  • 11
6
votes
2 answers

Space character within symbol literals

I need to query a database which contains names of companies. I have list of around 50 names, for which i have to get the data. But I am unable to write a query using in command as there spaces in a name which are not being recognized. ex select…
Mancunia89
  • 295
  • 1
  • 6
  • 16
6
votes
4 answers

How to terminate a remote KDB+ session via script?

I need to kill a remote KDB+ session. This can be done in several ways but I'd prefer to use IPC handlers. I start a KDB+ session: $ q -p 5000 KDB+ 3.0 2012.11.13 Copyright (C) 1993-2012 Kx Systems Then I start another KDB session and I manage to…
nunaxe
  • 1,432
  • 2
  • 15
  • 16
5
votes
3 answers

Passing db path to \l or .Q.l using a variable

I'm writing a q script that loads a db in a particular path and does some processing on it. The location of the db is currently hardcoded in the script, but I want to pass the db path as an argument and get it to load from the path in the…
Sahas
  • 10,637
  • 9
  • 41
  • 51
5
votes
1 answer

Getting the location of the current file in q (kdb)

Is there a way to get the location of the current running file in q in a similar fashion then Python's __file__.
user983716
  • 1,992
  • 1
  • 22
  • 32
5
votes
2 answers

kdb q - update statement in try catch

In q, say someone was naughty and created a function that sometimes returns a table with a mixed-type column: t:([] c1:(`a;"dfdf";`b;"ccvcv")) and sometimes a table with a symbol-only column: t:([] c1:`a`dfdf`b`ccvcv) I want to update c1 to…
tenticon
  • 2,639
  • 4
  • 32
  • 76