On this page
Query reports and Ask your data
Menu: Financial reports → Query reports.
Datasets
Queries run on rpt datasets only: sales lines, point-of-sale receipts and their lines, purchase lines, stock balances and movements, cash movements, monthly account balances, employee headcounts (with no personal data), the sales pipeline, inspection lots and quality notifications, operations jobs and contracts, and footfall (RP12). Amounts are in the functional currency, and returns and payments are negative.
You see a dataset if its module is in the subscription and you can view the matching report (for example, sales lines with rpt.sales_analysis.view). Every query runs under a read-only account dedicated to the tenant and within your data scope, for at most 15 seconds and 10,000 rows, and it's logged (RP13). For the operations jobs and contracts datasets, your scope also covers departments: a user limited to certain departments sees only their rows, and a row with no department is visible only to users who aren't limited by department (RP23).
The designer
- Choose the Dataset.
- Add Columns. For each column choose an Aggregate (Group by, Sum, Average, Minimum, Maximum, Count or Distinct count), and for dates a Period (day, week, month, quarter or year).
- Add Filters (equals, greater than, one of, contains, empty and so on).
- Select Run. The result appears in a table and a chart (bar, line or pie).
With the rpt.query.edit_sql permission, you can switch to SQL and write a single SELECT statement on the rpt datasets, with parameters written as @name. The system rejects statements that aren't allowed (changing data, external functions, system tables) with a clear message.
Saved reports
When you select Save, you're asked for a name, a description and the Visibility: Private (just you) or Shared (everyone with the view permission and access to the datasets). Only the report's owner can change or delete it (RP14).
- Excel and PDF are available with the
rpt.query_report.exportandrpt.query_report.printpermissions. Every export is recorded in the audit trail. - Scheduling: in Report schedules, choose the report Query report and then the saved report. It runs for each recipient with their own permissions and scope (RP7). A scheduled report can't be deleted until its schedules are deleted.
Ask your data
This needs the Analytics module and the analytics.ask_data.view permission. It stays off until the tenant administrator chooses a provider, the connection test passes, and the administrator turns it on in AI settings (RP9, AI4).
Type your question in Arabic or English (for example, "net sales per store last month") and select Ask. Only the structure of the datasets available to you and your question are sent to the AI provider the tenant administrator chose (or the platform's default provider). Your data is never sent. The resulting query then goes through the same checks and runs within your scope (RP18, AI1, AI6). If the provider is on a free tier, a notice appears below the question: This provider's free tier may use questions to improve its models. Each tenant has a monthly question allowance, and the number left appears below the button. The SQL text is shown only to users with rpt.query.edit_sql, who can open it in the editor and save it as a report.