Setup > Usage > Reports > Graphical query tool 

General presentation

The graphical query designer features a function that is used to create the inquiry screens used to display the results of the queries run on the database. It operates by temporary extraction of the data in a table, then by running an inquiry on this table. The inquiry can then be made at several levels of detail, defined by successive page breaks.

The structure of this temporary table enables each user to keep the results of the last query run on the database (unless it is a shared query). Using this functionality implies three different phases:

  • definition of the query by this function,
  • launch of the query (either using theor using the inquiry function and then the data refresh request).
  • inquiry of the query if it has already been executed.

A query can be formed from table fields or expressions.

Joins between tables are determined automatically from the dictionary, but is is possible to define them explicitly by drag-and-drop from the field from one table to another. As a preliminary condition, the destination field must belong to a key.

Let us underline the existence of two additional tools. An equivalent query tool to the present one, but in grid mode, and an SQL query tool going through identical inquiry screens but which purpose is to design queries based on the SQL language.

Management of the interface

The query creation field is composed of a floating pallet, a design area for the template and another area to place the selected fields.

Floating pallet

It contains the following buttons:

  • Table: Opens a selection list to add a table.
  • Expression: Opens the formula wizard in order to add an expression.
  • Erase: Reinitializes the query.
  • Codes: Checkbox to display the codes of the fields, in addition to the descriptions.
Design area for the template
The tables

The added tables are represented with their joins in this design area.

To add a table, click on the "Table" button of the floating pallet.

The possible actions on a table are:

  • Deletion by clicking on the cross in the upper right corner of the table. Warning, a table can only be deleted if all its links have been deleted and all its fields have been removed from the area where the fields have been placed.
    ../FCT/GESALT_01_01.jpg
  • Decrease/Increase via right-click on the button located to the left of the cross.
    ../FCT/GESALT_01_01.jpg  ../FCT/GESALT_01_02.jpg
  • Moving using the title bar or the lower bar.
  • Resizing of the table by means of the grip button in the lower right hand corner of said table.
    ../FCT/GESALT_01_03.jpg
Joins

The joins that have not been created automatically can be created by drag-and-drop from the source table field to the target table field. A left outer join is then created.

Clicking on a join displays a menu used to change the join type (left outer or inner join) or delete it.

Background

A drag-and-drop action to a free space in the design area makes it possible to reposition this space. Double-clicking is used to reposition the design area with respect to its origin.

../FCT/GESALT_01_04.jpg

Selected field location area

The area where the selected fields are located is used to:

  • View the fields in the form of thumbnails.
  • Modify the order and properties of these thumbnails (sort, total, ranges, visibility),
  • Manage the expressions.
  • Manage the query breaks.
Add a field

To add a table field, it is necessary to double-click on it or to perform a drag-and-drop action to the selected field location area.

Add an expression

To add an expression, it is necessary to click on the "Expression" button of the floating pallet.

Edit an expression

Click on the description of the expression to display the window of its properties.

Modify the properties of a thumbnail

Click on the icons to modify the values of the properties. A faded display specifies a negative value (for instance: not sorted).
../FCT/GESALT_02_02.jpg  ../FCT/GESALT_02_03.jpg
Meaning of the icons from left to right: Visible, sort, total, range entry

Delete a thumbnail

Click on the cross in the upper right hand corner of the thumbnail.
../FCT/GESALT_02_01.jpg

Move a thumbnail

Click on the grip in the upper part of the thumbnail and move it without releasing pressure on the mouse button, then release on required position. Thumbnails can only be moved on a similar level.
../FCT/GESALT_02_01.jpg

Create a break level (group)

Click on the thumbnail grip, a menu appears with different descriptions. Select "Create a group" to put the thumbnail at the top of a new group.

Move a thumbnail to an existing break level

Click on the thumbnail grip, a menu appears with different descriptions. Select "Group N" where N represents the group level, to move the thumbnail to the bottom of the selected level.

Prerequisites

SEEREFERTTO Refer to documentation Implementation

Screen management

The definition of a request is made over three tabs. The first tab is used to define the information to be printed. When the request is simple, it will be sufficient to enter the information in this tab. The second tab, called Advanced, makes it possible to cerate a more sophisticated report, by specifying the table join conditions and by giving additional information for the display and printing. The third tab is used if necessary to define in a more sophisticated fashion the access rules for the request.

Header

Presentation

This section provides information to identify the query and some setups of a general nature.

Close

 

Fields

The following fields are present on this tab :

This code is used to identify a request.

  • Title (field INTIT)

It used to define a name associated with each record.

  • Short title (field INTITSHO)

This title, which provides a description of the record, is used in some screens or records when there is not enough space to visualize the long title.

Close

 

Tab Fields

Presentation

This tab is used to define and regroup the information to be edited thanks to a visual editor.

Using all the information defined in this editor, the query designer specifies a query on tables linked by join conditions. Thus, in simple cases, it is not necessary to complete the next tabs.

Close

 

Fields

The following fields are present on this tab :

Block number 1

  • Active (field ENAFLG)

This check box is used to activate or deactivate the current record without losing its content.

A deactivated record cannot be used (by calling its code) in other records (documents, setups, etc.) or during mass processings.

The authorizations for a given function can prohibit the creation of an active record. In this case, the box is cleared by default and it can only be modified by an authorized user or via a signature circuit defined by Workflow.

Block number 2

  • field CLBFL

 

Close

 

Tab Advanced

Presentation

This tab is used to enter additional information. On one hand, the information necessary for the use of the request :

   a number of lines and a fixed number of columns that serve to define the vertical and horizontal pagination characteristics for the enquiry screen generated by the requester.

*   a maximum number of lines and a maximum time, which can be entered as required for instance for test purposes, to limit the machine load when the request is launched. The maximum number of lines corresponds to a request parameter (maxrows) that stops the search once the number of lines satisfies the conditions that have been found in the database (these lines will then be sorted, but the database does not guarantee that the N lines found are the first N in the sort order). The second parameter limits the time in seconds for the construction of the table that will then be interrogated. Warning, this time is not the execution time for the request.

*   the code of a report that will be associated with the File / List function from the requests enquiry. If this is not entered, the report ALISTE is used, which will propose a default page format. It is possible to duplicate this generic report (in principle it will then only be necessary to modify the page format) to create reports perfectly defined for the request defined in this way.

On the other hand the additional conditions linked to the request :

   the selection criteria, which are the logical expressions applied to the fields in the table, and can include constants, functions and operators. Only the lines in the table that satisfy these conditions will be extracted. The formula editor is used to simplify the writing of such expressions.

    the conditions for the link between the different tables in the request. In the absence of conditions, the requestor searches for the possible links itself. But in certain cases, there may be multiple links and in this case the link that is chosen is randomly : for example, from the order header to the customer, there are 4 different links to the customer (sold-to, paying, bill-to, group). Thus it is preferable, in the complex cases, to define the links explicitly.

The definition of a link is made with the help of the syntax [F:ABV1]CLE=expression1 ; expression2 ..., or :

*    [F:ABV1]CLE is the key of the linked table. Using the right click, there is access to the Table choice function, which proposes the list of all the tables presented in the first tab. The selection of a table leads to display a first index in the table. If another index is required, the function Choice of an index is also accessible via right click, which will propose the choice from amongst the list of all the indexes for the table previously selected.

*    expression1, expression2 are the expression are used to give the values to the different fields the key previously defined (if the key is made up of a single part, there is only one expression, if not the expressions are separated by a semi-colon). Also available is the Choice of field function, which can be used to enter the different values for the key in the fields for one of the tables concerned. After the choice of the key, which displays the number of semi-colons defining the sections of the key to be entered, this function is used to successively fill all the missing sections. It should be noted that it is also possible to enter the constant sections of the key (for example, it is possible to imagine a link to the analytical dimensions table by fixing the first field to a given analytical dimension).

Close

 

Fields

The following fields are present on this tab :

Block number 1

  • Number of lines (field NBRLIG)

Used to define a logical number of lines by page in the inquiry screen generated by the query designer. If this number of lines exceeds the number of physical lines that can be displayed, a scrolling bar appears on the righthand side of the grid. Buttons located in the upper part of the screen will enable navigation between logical pages (view next, previous, last, first page).

  • Maximum lines (field MAXLIG)

The maximum number of lines corresponds to a query parameter (maxrows) that stops the search once the number of lines meets the conditions that have been found in the database (these lines will then be sorted, but the database does not guarantee that the N lines found are the first N in the sort order). This represents an optimization used to limit the database load.

  • No. fixed columns (field NBRCOL)

Makes it possible to fix the first x columns of a grid in the case of horizontal paging.

  • Maximum times (field MAXTIM)

Allows the stopping of the search after this period of time. (expressed in seconds) This makes it possible to avoid waiting too long a time, namely in the case where a new query is being set up.

Note: Contrary to the maximum number of lines, this information is not transmitted to the data base. The maximum time can be exceeded if the duration of the inquiry is too long.

It defines the code of a report that will be associated with the File / List function from the query inquiry. If this is not entered, the report ALISTE is used, which will submit a default page format. It is possible to duplicate this generic report (in principle it will then only be necessary to modify the page format) to create reports perfectly defined for the query thus defined.

The report code entered here can be associated with a set of print codes via the dedicated function.

Selections

  • Selection criteria (field SEL)

Used to enter selection criteria, which are logical expressions applied to table fields, and that can include constants, functions and operators. Only the lines in the table that meet these conditions will be extracted. The formula editor is used to simplify the writing of such expressions.

Links

  • Link expression (field LNK)

It is necessary to define here the links that have not been defined in the dictionay or which have to be used in priority. The link structure must correspond to the key of the file to be linked. It must have as many fields separated by semi-colons as key parts. In effect, the exact syntax is the following:

[F:ABV1]CLE=expression1 ; expression2..., where:

*    [F:ABV1]CLE is the key of the linked table. Using the right click provides access to the Choose a table function, which submits the list of all the tables presented in the first tab. Selecting a table leads to the display of the first index in the table. If another index is required, the function Choose an index is also accessible via right click, which will make it possible to choose from amongst the list of all the indices for the table previously selected.

*    expression1, expression2 represent the expressions used to give values to the various fields of the previously defined key (if the key has only one part, there is only one expression, otherwise, the expressions are separated by a semi-colon). There is also the Choose a field function, used to enter the various values of the key with fields of one of the tables concerned. After the choice of the key, which displays the number of semi-colons defining the sections of the key to be entered, this function is used to successively fill all the missing sections. It should be underlined that constant key parts can be defined.

From the database perspective, this syntax defines left outer joins. It should be noted that a second syntax enables strict joins to be created (which can be interesting from a performance point of view). A tilde (~) is then added to the syntax which becomes:

[F:ABV1]CLE=expression1 ; expression2...

Close

 

Tab Access

Presentation

This tab is used to define the access conditions to the query and the extracted data.

Close

 

Fields

The following fields are present on this tab :

  • Query type (field ALLUSR)

Used to manage the display of a query in inquiry mode, with the following behaviors:

  • Normal query: the result of the query is displayed if the query has already been viewed by the user. In effect, if the box is not checked, each user launching the query creates a set of data that belongs to them and which cannot be viewed by anyone else.
  • Shared query: the result of the execution of this query by a user can be viewed by other users. Shared queries are useful in that when a large query is launched at a given moment by a single user, a group of users can then access the common information. It is recommended, for this type of query, that only one user can run the query, the others having inquiry access. In addition, it is preferable to run this type of query in batch mode if it is particularly large; the corresponding batch task code is called CALALH.
  • Recalculated query: the result of the query is never displayed automatically. It is necessary to press on the button to refresh or enter the criteria. This type of query is interesting in that it makes it possible to avoid reloading data if they are known to become rapidly obsolete.
  • Group (field GRP)

Used to make a classification criterion available for requests.

This access code is used to to limit access to the current record for certain users.
If the field is entered, only the users having this access code in their profiles can view and modify this record.

The execution right controls who can execute the query in question (by refreshing the query or by modifying the parameters and then re-running it).

Used to determine the authorization filters applied to the forming of the query. These filters are the filters by site, by role and by access code.

The filtering principles are the following:

  • The object code is used to define the access code and site code fields on which the filter will be applied.
  • This filter is then carried out based on the authorized sites and access rights assigned for object management to the user running the query.
  • Similarly, the filter on the roles, defined by the object code, is also applied.

This of course supposes that the table on which the filters are carried out is part of the generated query. What is meant here is the table containing the access codeand site code fields, and, when necessary, the field defined by the roles assigned to the user. This is not necessarily the main table in the query: for instance, a query on document lines can be filtered with respect to authorizations given for the fields of tables linked to the document header.

Warning, these filters are only applied during the running of the query and not during inquiry. This is important if the query is shared, for instance, or if the filters by site for a user have changed between the time when the query has been calculated and the time when it is viewed.

Used to link the authorizations to access the query with those authorizations granted on the function.

The principle is as follows: upon entering the query, it is checked that the linked fucntion is authorized to the user (for at least one site, if the authorization on said function is granted by site). This is checked only in the case when this query is not shared.

In effect, if the query is shared, it is admitted that the authorizations of the person that run the query are applied and shared with all those that have the right to view it. It is therefore necessary to be very careful when defining the authorizations of the shared queries if they concern sensitive data. This is done using the access code located in this tab.

Close

 

Tab Graphic

Fields

The following fields are present on this tab :

Block number 1

  • Representation (field REPGRA)

This indicator defines the fashion in which the representation of the data will be made in the screen. The possibilities offered are as follows :

  • Character :  the data is uniquely represented un the form of a grid.
  • Char. or Graph. : the data are presented in the form of one or to modes. The default mode is determined by the field Default display defined in the graphical parameters of the record.
  • Char. and Graph. : the data is presented in the both modes simultaneously. The graphical position  with respect to the grid is determined by the field Position for the Graph tab.
  • Character :  the data is uniquely presented in the form of a graph.
  • field OPTGRA

Used to organize the relationship between the character and the graphic, when the presentation mode for the data allows both. According to the case :

  • if the representation is Char or Graph, the default value is chosen for the representation.
  • If the representation is Char and Graph, the position of the graph is given with respect to the data grid.

Block number 3

  • field IMAG

Image explaining the information previously entered.

Graph

  • Type (field TYPGRA)

This field is used once there is more than one numeric value in the grid that is likely to be presented in a graphical form. It can take one of two values :

  • Single graph : in this case, only one column of values is displayed at a time (a selector is used to make to choice)/
  • Multi-graph : in this case, all the columns are displayed, combined according to the parameter defined by the parameter Representation.
  • Representation (field FSHGRA)

When several series are presented in the graph (provided that the presentation of all the series is identical and is not by sector type), it is possible to specify how the series values are combined in the display, by entering the following value :

  • Multiis used to present the values of each series side by side (one color by series)
  • Cumulative is used to present the values in a vertical total.
  • Comparative is used to present them in a relative comparison (the height of the graph is constant).
  • Default graph (field DEFGRA)

Defines the graphical representation used for the data to be presented (from the choices Bars, Lines, Area, Sectors). An image is displayed as a function of the choice made illustrating the type of presentation obtained.

If only one series of values is available, the graphical representation is by default fixed by this parameter.

If several series of values are presented, it is possible to mix the presentation modes (one series in the form of bars, another in the form of lines for example). In this case, each series of values is represented as a function of the field Representation located in the grid of fields :

  • if it is Baror Line, this representation mode is used for the series of values concerned if it is compatible with the default graphical representation (it is not possible to mix sectors with bars or lines).
  • if it is Default, the default graphical representation for the series is used.

When used, if the representation of the series is homogenous (that is there is only one series in the graph), there is a graph type selector for the user to select a different mode of presentation.

Block number 4

Close

 

Specific Buttons

The following fields are present on the window opened through this button :

Block number 1

  • field OBJET

 

  • field CLES

 

Block number 2

  • From folder (field DOSORG)

This field is used to define the folder from which the record is going be copied. The possible syntaxes are described in the dedicated appendix.

  • All folders (field TOUDOS)

This option is used to copy the record to all the folders defined in the dictionary (ADOSSIER table from the current solution).

  • To folder (field DOSDES)

This field used to define the folder in which the record is going be copied. The possible syntaxes are described in the dedicated appendix.

Close

This button is used to copy the record definition from or to another folder.

This button is used to execute the current request. The execution triggers the update of a temporary table and links to the request display function, which is used to view the detail of the movements, but also to successively aggregate at the different break levels defined.

Error messages

In addition to the generic error messages, the following messages can appear during the entry :

Too many sort criteria

Too many ranges

Too many totals

The limits are exceeded in the query. The number of sort criteria is limited to 8 and the number of ranges and totals is limited to 10.

Table not defined

A calculation formula has been used in an expression that includes the fields for a table that is not linked.

xxx: Non existent table

yyy: Non-existent field

The table or the field does not exist in the dictionary.

Index incorrect

A field is indexed with a value that exceeds the dimension of the field.

Links impossible

The links between the tables could not be established from the dictionary. Either there is an error in the request, or it will be necessary to specify in a detailed fashion the links in the Advanced tab.

This field has already been selected.

An attempt has been made to add a field in the selected fields, but this field already exists.

Action unknown

The flash component has sent an action not managed by the supervisor

Links impossible The fields must be of the same type

It is not possible to set up links between table fields of a different type. For example: a numerical field cannot be linked to an alphanumerical key field

Link impossible. Key component already entered

Whenever a link has been set up with the key of a table, links need to be set up with all parts of this key This message is displayed if an attempt is made at setting up a link on a field that does not belong to this key.

Link impossible. Existing key incomplete

The link has not been defined on all the fields of the key.

Link impossible. Non-existent key

An attempt has been made to set up a link on a field that does not belong to a key.

A least a description-type and a value-type field is required to use this graph

When the "Graphical representation" field is activated, one field among the selected fields needs to be selected for the graph titles, and at least another one for the graph calculation.

Data type not managed

It is not possible to use a clob (text file) type or blob (image file) type field in the expressions of the selected fields.

Tables used

SEEREFERTTO Refer to documentation Implementation