If you don't have a PushMetrics account yet, you can sign up here and start a 14-day free trial.
Every new account comes with a (read-only) SQL database connection with some demo data to play with.
In PushMetrics, Notebooks are the documents in which you create all your workflows.
Notebooks contain the tasks and the logic of a workflow, they can be executed and scheduled.
To create your first notebook, select "New Notebook" from the menu on the home screen.
You can either use a Notebook template or you can start on a blank page and build a workflow from scratch.
For this tutorial, please select the "Share SQL query result via Email" template:
Nice - you have just created your first notebook!
It should look like this:
As you can see, there are two tasks in the notebook:
query_1
email_1
In the next step, we will customize those tasks to our needs.
Now is a good time to connect your own SQL database, so you can create your first report with your own data.
Go to the SQL query task and click on the database icon in the top left.
From this menu, you decide which database the query should be run against.
From the menu, select "New Database".
Next, select your Database Type and fill out the corresponding form.
Make sure your database is accessible to PushMetrics' servers.
Now it's time to execute your first SQL query.
Let's first take a look at the sidebar on the left. Here, you can explore the database's contents like schemas, tables, and columns - making it easier to develop your SQL queries.
When hovering over a table name, you can also preview 100 rows of any table and copy a SELECT *
statement to your clipboard.
If you are connected to your own database, simply change the query to something that works on your database.
If you use the demo database, you can just leave the query as it is and hit the run button (the play icon).
You can also run a query with the keyboard shortcut ⌘ + enter
.
After a short moment, you should see the query results below the SQL statement.
Now that we have our query results, let's send them out via email.
Let's have a closer look at the email task:
{{ utils.user_email }}
- this is a utility function that ships with PushMetrics. It returns the email of the current user (i.e. your email). .export()
function on our SQL task query_1
. The first one will give us the results as a CSV, the second as a XLSX file.{{ query_1.data[0].sales }}
to the body of the email and upon sending it would print the value of the "sales" column of the first row from the SQL result.Our first simple workflow is ready to go. Let's execute it by clicking on the "Execute" button in the top right.
Now, PushMetrics will run all tasks in the Notebook. It will figure out the right order automatically.
In this example, it understands that we first need to run the SQL query and only afterward can send the email.
Check your inbox:
Instead of having to run this report manually all the time, we want to automate it and run it regularly on a schedule.
Scheduling notebooks is very easy.
Click on the Schedule button in the top navigation bar.
...
and select "Run Now"If you want to understand in more detail what has been run or if you need to debug problems, the Execution Log is a great resource.
You can find it in the left sidebar:
This will send you to the history of all the individual task and page executions of your current notebook.
Here you can find more details about the status of your runs and task executions and you can see the full log of an execution.
Finally, you may want to share your notebook with some colleagues.
PushMetrics notebooks can be easily shared with your team - pretty much like a Google Doc.
Just click on the "Share" button and define your sharing settings for the notebook.
Welcome aboard!
Don't hesitate to contact us if you have questions!
Check out the Advanced Guide for a tutorial where you create a more complex reporting pipeline using conditional statements, loops, slack messages, and more from scratch.