Creating a kdb+ Form in Pulse
Download Pulse
Add kdb+ Server Connection
To add a connection goto Connections->"Add Data Connection" and fill in your details.
You can try clicking test to see if the connection works before adding it.
Populating the Tables
Copy and Paste the below code into the SQL Editor and press "Send Query":
You can run "-1000 sublist select from trade" to check the data is there:
- Go to the SQL Editor
- Make sure your data source is selected
- Enter your SQL query
- Click
Run All
or press ctrl+E
Add and Edit Dashboard
- On the dashboards listing page, click add
- Click on the newly created dashboard to go into it. Either click on edit or toggle design mode once in the dashboard.
Add Historic Trade Blotter
- Click
Table
to add that component - Make sure your kdb+ data source is selected
- Select the refresh rate.
Only On Interaction
- Enter your SQL query
-1000 sublist select from trade
click save or press ctrl+E
Creating a Form
Adding your first dropdown
- Click
User Form
to add that component. - Click Dropdown Button to add a dropdown to the form.
- Select
SQL
data source. - Select your kdb+ data source.
- Select a low
refresh rate
as these options are unlikely to change often. - Enter your SQL query
asc select distinct sym from trade
click save. - Click on the dropdown to check it's contents.
Connecting the Dropdown to your Table
Pulse allows creating interactive dashboards, a user can either push a button, select a dropdown, click a chart or table that then displays a customized resulting table or chart.
Pulse enables this interaction by using variables.
When a user clicks a Dropdown, a variable is populated.
If that variable is referenced in an SQL query, the query is ran and the result updated.
To connect our dropdown select to the table query:
- Check the
key
name of the dropdown in the form. In the screenshot below it is calledkey1
- Change the table query to be
-1000 sublist select from trade where sym =`${{key1}}
. - Select a dropdown entry and watch the table update.
Adding Checkboxes
We want to add additional filters for orderType, size and to only run the query when a user clicks submit.
- Add Checkbox to the existing Form
- Select SQL data source.
- Select a low
refresh rate
.
Enter your SQL queryasc select distinct orderType from trade
click save. - A list of checkboxes for order types will be displayed in the form.
Adding Numeric Slider
- Add Slider to the existing Form
- Enter
perc
as the key for the numeric slider.
Adding a Submit Button
Click to add a submit button to the form, notice it has the key submit_4
Connect Form to Table
To connect the new input components to the form, click on the grid and replace the query with:
Complete
Select values for each input. Notice the grid is not being updated. Only once you hit submit will the form update.
Thanks for watching our demo. Please download Pulse to give it a try for yourself.