This section provides examples of Pivot report from the creation of the Data source (SQL Query) to the final report.
For the data source, we will be inspired by the query from the "Orders" data source.
We will just add what it takes to have the representative of each order.
The request is as follows:
To create this data source, go to the module's configuration page and then the "Data sources" tab.
Click on "News data source".
In the dialog that appears:
In the "Data Source Name" field, type "Sales by Representative"
Copy / Paste the above SQL query into the "Data Source" field
Click on "Create"
P>
The new data source is then added to the list of Available Data Sources.
By opening the main screen of the module (click on the top menu "Pivot Reports"), we notice that:
- A new entry "Sales by Representative" has been added to the left menu
- By clicking on this entry in the left menu, a default empty report has been created and is called "Default".
To create the report "Sales by Representative by Year" as a histogram, we will proceed as follows:
N.B. This example assumes there is only one salesperson per order.
If you assign multiple sales representatives to a command, it is necessary to adapt the SQL query above accordingly.