Supervisor Administration Statistics

Full version 7 function Application/Contract x3/$$PROD Class STATS('code') Representation STATS~code Facet $cube

This function allows you to display statistical inquiries based on the statistics definition. Statistics are defined by the GESPS2 function.

Introduction Creating a statistical inquiry Accessing the statistical page Entering information on a statistical page
Displaying a statistical page Additional parameters Formatting rules for the amounts Limits of the statistical function

1. Introduction

When a statistical code is created by the statistics definition (GESPS2), the validation adds a dedicated program that generates a JSON feed and a prototype to display the result of a statistical inquiry.

2. Creating a statistical inquiry

Creating a statistical inquiry is done through the GESPS2 function. When the request is validated, the Supervisor creates the following:

  • The script previously used to manage the update of the statistical inquiry.
  • A new Sage X3 script file that can be called through a class and a representation with the new client. This script returns the data to be presented.

3. Accessing the statistical inquiry

Example: To access the statistical inquiry for a request called MYSTAT, you have to create a menu item with the following parameters:

  • Link type: "Representation".
  • Associated class: "STAT("MYSTAT")".
  • Representation: "QUERY~MYSTAT".
  • Facet: "cube".

This link provides access to the statistical display, including a graphical representation of the lines.

Additional parameters can be sent through the URL with the &parameter=value syntax.

Once this is done, clicking the link associated with the menu item gives access to the request display and execution function.

4. Entering information on a statistical page

Entering information on a statistical page displays the statistical inquiry results at the first level.

5. Displaying a statistical page

The statistical page is displayed with a graphical representation and a grid presenting the data lines. You can drill down this data through different levels.

6. Additional parameters

The URL of the page can accept other parameters. The default URL generated from the setup of the menu item is structured as follows:

(server_URL)/html/main.html?url=/sdata/x3/$$prod/FOLDER/STATS('STAT_NAM')?representation=STATS~STAT_NAM.$cube

Where:

  • STAT_NAM is the name of the statistic.
  • FOLDER is the Sage X3 folder in which the statistic is executed.

Additional parameters can be added at the end of the URL in the following format: &parameter_name=value

For example, you can have a URL that ends with: STATS('STAT_NAM')?representation=STATS~STAT_NAM.$cube&DATBEG1=2013-01-01&DATEND1=2013-12-31

The list of parameters available is provided in the table below:

Parameter name Possible values Default value Use Example
DATBEG1 Date value in
yyyy-mm-dd format.
Value of user parameter DATSTADEB The range of dates used to calculate the statistical data. &DATBEG1=2013-01-01
DATEND1 Value of user parameter DATSTAFIN &DATEND1=2013-12-31
DATBEG2 Date value in
yyyy-mm-dd format.
The previous range of date with the same length as DATBEG1 and DATEND1. The range of dates used to calculate the previous period statistical data. &DATBEG2=2012-01-01
DATEND2 &DATEND2=2012-12-31
COMPANY Company code None Filters the statistical data.
Used only if the statistical code is set up at the company or site level.
If the parameter is present but empty (1), the calculation is done for all companies.
If the parameter is omitted (2), the default value is the company associated with the default site of the user for the module the statistics belong to.
&COMPANY=SAGE
FACILITY Facility (site) code. None Filters the statistical data.
Used only if the statistical code is set up at the site level.
If the parameter is present but empty (1), the calculation is done for all sites.
If the parameter is omitted (2), the default value is the default site of the user for the module the statistics belong to.
&FACILITY=PARIS
xxxx (where xxxx is the name of a field in the statistical definition (3)). Value with the correct data type. None Filters the statistical data based on the value of the parameter.
If a value is given for the Nth field without values given for the (N-1)th values, the value is not used.
If empty, no filter is given.
If the N first values are given, the statistical data is displayed at level N+1.
&ITEM=BOOK025
&MFI_ITMREF=CD100
PORTVIEW Dashboard view code. None Sets the values not defined by using the formula calculated in the dashboard view definition (date range, companies and sites, and other values).
If empty, the calculation is done for all sites.
&PORTVIEW=MYVIEW
$axes Axes definition None Sets the axes to a default value (SData format for multi-dimensional format) in JSURL format.
$slicer Slicer definition None Sets the slicer to a default value (SData format for multi-dimensional format) in JSURL format.

Comments:

(1) In a dashboard view, the parameter is considered empty if there is a formula that returns an empty value (for example, "" or space$(0)). In the URL, the corresponding case is &PARAMETER=&OTHERPARAM=....

(2) In a dashboard view, the parameter is considered absent if there is no formula for it. In this case, the URL does not contain string &PARAMETER =....

(3) The name of the field is the one found in the dictionary definition. If an abbreviation is provided for a line, the name is prefixed with the abbreviation followed by an underscore. For example, if a first ITMREF field is defined with the "MFM" abbreviation, and a second ITMREF field is defined with the "MFI" abbreviation, field codes "MFM_ITMREF" and "MFI_ITMREF" can be sent as parameters.

7. Formatting rules for the amounts

The amounts presented in the statistical inquiries are formatted with the following rules:

  • Any percentage or accumulated percentage is formatted with three digits plus two decimals.
  • A format is used if it has been defined for the amount in the Advanced tab of the statistical code.
    If not, the format to be used is the one defined by global parameter FMTSTA.
  • When a format has more than three digits before the decimal separator, the format uses three-digit separators based on the locale preferences.

Note: If the FMTSTA parameter is modified, you have to re-validate the statistical parameters to use the new format.

8. Limits of the statistical function

For performance reasons, viewing the statistics is only possible in ascending order for the criteria. The final zoom that displays the detail of the table is not implemented.