In the Workflow editor, to schedule the delivery time, both in Simple Report as well as in Mail Merge Report, there is a dedicated section. To check an SQL condition before a report is sent, see below.
Schedule a Workflow
By default the scheduling will be set to run right away, once a day (same time as when you create the repor), ending never. The timezone will be set to your current timezone, if you’re sharing it. While you’re making changes to your scheduling you can check on the right-hand side when exactly your next 10 Workflows will trigger.
Note: The greater the interval you choose the more options will become available.
- Minutely, Hourly, and Daily only have a Start, and Interval, and an End.
- Weekdays and Weekly allow an additional choice for the days of the week.
- Monthly and Yearly allow sophisticated options of Dates and Days, as well as, Weekdays or Weekend Days, and the option to choose things like First or Last.
E.g.: Every last day of the year; The first weekday of every month.
The advanced type of scheduling will allow you to use even more options using RRules. You will find all necessary documentation following the given Link. When pasting you RRule string back into the scheduler, make sure to only include the statement after the ‘RRule:’.
- Sample RRule: Need a quarterly report that sends on the next available weekday?
Read: Send a Report every first WEEKDAY of the Quarter. Starting date and time is set in the Scheduler.
Check SQL condition before execution
With this feature, the report will run only if a certain condition is met.
It is possible to load an SQL Query previously created using the SQL Lab; or create a new one using the ‘Raw SQL Query’ button. Below, you choose what result runs the Workflow: if the query results in TRUE, FALSE, EMPTY or NOT EMPTY. If you’re writing your query from scratch, you can first test it in the SQL Lab.
- Sample SQL: Only send a report when Sales were above 100000 in the last 10 days?
SELECT CASE WHEN sum(sales) > 100000 THEN 'True' ELSE 'False' END FROM demo_data.store_oders WHERE order_date > order_date - 10