kdb Questions

5

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 Syste...
kdb
Boehmite asked 4/2, 2013 at 16:19

4

Solved

I need to write a function in q/kdb which takes a variable v and returns 1b if v is defined and 0b if it is not: $ a:2 $ doesExist`a 1b $ doesExist`b 0b Any ideas appreciated.
kdb
Manfred asked 23/7, 2014 at 23:4

2

Solved

How can I use a string as a variable name? I want my variable name to be constructed during runtime, but how can I use it as a left argument and assign a value to it? Example: [`$"test"] : 1 / ...
kdb
Fenton asked 26/4, 2015 at 11:18

3

Solved

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*" thi...
kdb
Emory asked 27/10, 2015 at 15:49

5

Any ideas how to do this nicely in KDB? Consider the table X:([]a:1 2 3;b:`abc11`abc22`abc33;c:10 20 30) I now want a new table Y that has the "abc" stripped out of the symbols in the second co...
Hyperpituitarism asked 21/4, 2014 at 17:40

1

I am trying to implement an aggregation table that collates data from multiple disparate tables into one for feature engineering, preprocessing and normalization. I am facing numerous problems the ...
kdb
Swiss asked 5/9, 2019 at 23:24

2

Given the following table: time | col1 col2 col3 ... -------------------------------- 10:53:02 | 89 89 76 ... ... How does one select a subset of columns from this table (including the index) re...
kdb
Meathead asked 3/9, 2019 at 21:46

2

Solved

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.2...
kdb
Manrope asked 5/6, 2019 at 4:58

2

I have this table for stock prices (simplified version here): +----------+--------+-------+ | Time | Ticker | Price | +----------+--------+-------+ | 10:00:00 | A | 5 | | 10:00:01 | A | 6 | | 10:0...
kdb
Trustworthy asked 21/6, 2018 at 20:54

2

Solved

Consider the following table: myTable: a b ------- 1 2 3 10 4 50 5 30 How do I replace the empty cells of b with a zero? So the result would be: a b ------- 1 0 2 0 3 10 4 50 5 30 Right now...
kdb
Pharmacology asked 3/5, 2015 at 17:7

1

Solved

Is there a way to get the location of the current running file in q in a similar fashion then Python's __file__.
kdb
Hargrove asked 27/4, 2018 at 1:3

2

Solved

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...
kdb
Ukulele asked 22/3, 2018 at 11:48

4

Solved

Is there a neat way of looking up the key of a dictionary by an atom value if that atom is inside a value list ? Assumption: The value lists of the dictionary have each unique elements Example: ...
Smokechaser asked 12/2, 2018 at 14:11

2

Solved

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 th...
kdb
Scuffle asked 13/2, 2018 at 6:35

1

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, ...
Mercurochrome asked 14/5, 2014 at 19:1

4

Solved

I have a KDB/Q databse which has around ~2M records per day consuming about ~2G of memory. At end of day it runs some reporting stuff doing joins between the tables and outputting result into files...
kdb
Pence asked 16/4, 2012 at 9:43

2

Solved

I have a table in kdb with 3 columns: date, currency, fx rate. Some of the fx are missing, and I want to replace the null fx by the value on the previous day, for the same currency obviously. I can...
Gurgitation asked 16/8, 2017 at 15:10

3

Solved

What are the ways to in Q to use the results of a nested query in a where clause? I'm looking for something similar to SQL statement. select from food where type_id in ( select type_id from type...
Solo asked 17/7, 2011 at 18:19

3

Solved

kdb+ has an aj function that is usually used to join tables along time columns. Here is an example where I have trade and quote tables and I get the prevailing quote for every trade. q)5# t time sy...
Talos asked 7/9, 2012 at 16:49

4

Solved

What is the equivalent query in KDB Web: SELECT * FROM TABLE WHERE (COLA = 'A' AND COLB = 'B') OR (COLA = 'C' AND COLB = 'D') http://kdbserver:5001/?select fro table where _____________________ ...
kdb
Oilskin asked 7/11, 2014 at 14:58

3

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:...
Eulogist asked 3/6, 2014 at 17:18

7

I am learning q on kdb database. I am concerned by the fact that there are no loops in q. I need to write an algorithm that I would write with several nested for-loops in a verbose program like C. ...
kdb
Banausic asked 24/5, 2013 at 8:7

1

I have following table: q) t:([s:`symbol$()] id:();id2:`int$()) where 's' is a primary key and 'id' col has general type. I am trying to understand following behavior when inserting a list (str...
Torsion asked 7/8, 2015 at 13:54

1

Solved

how can I access functions/variables in the root namespace once I jumped into another namespace. Example like this: q)\d .cfg q)domIV:1000 q)\d . q)n:1000 And then later on I know how to acces...
Llama asked 7/6, 2015 at 7:2

1

Solved

I'm trying to find the memory usage of an in-memory table in q. How can I display this? It is receiving live updates and I would like to keep track of the total used memory of such a table. I can...
kdb
Splint asked 2/2, 2015 at 20:54

© 2022 - 2024 — McMap. All rights reserved.