To create a new query go to the queries list, click on "New query" on the top right.
On the query editing page you can start by adding a name, description and tags (1)
Next is the area where the SQL query can be written (2), the open scheme explorer button allows to open the db tables browser to see all available tables and fields (3).
At the bottom of this area you can see a preview of the query results.
After creating the query you can add the next step which is the arrow down at (4)
this next step can be one of the following categories:
Choice of the type of the visualization for the query result
The scripter step which can run Ruby/Python/C# code on the query result
SQL - which can allow to create an additional query
Date filter - will be presented as part of the actual dashboard and allow the user to filter the query result by time frame
Query filter - will be presented for the user and will allow to filter query rows by an of the parameters (column headers)
At the end of the page you can see a preview of the query as it will appear on the dashboard.