Hi All,
My apologies for asking basic question.I am new to KDB. Can someone please let me know how i can pass two parameters to a KDB query. I am reading QForMortals, but this is not mentioned there.
maxpx:{[t;range] select max px from t where date within range}
here how i can pass both t and range to maxpx.Could you please explain with an example?
Thanks,
Hi John,
When calling a function with multiple parameters, you should separate them with a semi colon, as shown below.
q)testquery:{[a;b] c:a + b; :c}
q)sumvalue:testquery**[100;50]**
q)sumvalue
150
In your case, something like:
maxpx[tablename;2016.05.06 2016.05.09]<font face='"arial,' sans-serif>Regards,
Matt
Welcome John - I know Matt has answered your question, but for you to read after the example…this is in QForMortalshttp://code.kx.com/wiki/JB:QforMortals2/functions#Function_Specificationspecifically sections 1.2.1 -> 1.2.3Thanks________________________________From: personal-kdbplus@googlegroups.com [personal-kdbplus@googlegroups.com] on behalf of john Anderson [john.ags1984@gmail.com]Sent: 05 October 2016 06:27To: Kdb+ Personal DevelopersSubject: [personal kdb+] Passing multiple parameters to a KDB queryHi All,My apologies for asking basic question.I am new to KDB. Can someone please let me know how i can pass two parameters to a KDB query. I am reading QForMortals, but this is not mentioned there.maxpx:{[t;range] select max px from t where date within range}here how i can pass both t and range to maxpx.Could you please explain with an example?Thanks,-- Submitted via Google Groups