This documentation supports the 19.02 version of Remedy IT Service Management Suite.

To view the latest version, select the version from the Product version menu.

Advanced Authoring

Use the Advanced Authoring option to create reports by using complex database queries. You can use this option to create complex reports by using the complex database functions that contain multiple parts, such as over, partition by, order by, and so on, in a single function. To know more about how to run a complex database function by using the Advanced Authoring option, see Examples of how to execute complex database functions having multiple parts.


Important

You can use Advanced Authoring for MS SQL and Oracle database only.

You must have the Admin, Corp Writer, or Report Writer role to use Advanced Authoring.

To create a report using Advanced Authoring

 Click here to expand...
  1. On the Remedy Smart Reporting Admin Console, click + button to create a new Report.
  2. In the New Report window:
    1. Enable Advanced Authoring.

    2. In the Author Method field, select Freehand SQL.
    3. Select Data Source.

    4. Click Create Analysis button at the bottom of the New Report window.

  3. To write complex queries, in the SQL Query editor, perform the following steps:
    1. Enter the SQL query for creating the report. For examples of complex queries, see Examples.

    2. Click Validate.
    3. Click Save.

The report fields are saved to a folder called SQLFields in the Data tab, and the report data is displayed on the right.


Examples of how to execute complex database functions having multiple parts

You can execute complex functions using the Advanced Authoring option.

Example 1

LAG(`Short_desc` , 1) over (partition by `Short_desc`  order by `Short_Desc`)

To run this function by using Advanced Authoring, type the following query in the SQL Query editor:

SELECT DBFN('lag;over;partition by;order by', 4, '#KWD#(' , `Short Description` , 1 , '#KWD#)' , 1, '#KWD#(' , 1 , `Short Description` , 2 , `Short Description` , '#KWD#)') FROM 'AR System Schema'.'Test:Form'

The following table describes how to interpret the DBFN functionality:

ArgumentDescription
lag;over;partition by;order byIndicates all parts in the function.
4Indicates number of arguments in the first part - (, Short_desc, 1, and ).
The opening and closing brackets are prefixed with the string #KWD#. For example, #KWD#( or #KWD#).
1Indicates the number of arguments in the next part over, which has only one argument, (, that is prefixed by #KWD#.
1Indicates the number of arguments in the next part partition by, which has only one argument Short Description.
2Indicates the number of arguments in the next part order by, which has only two arguments Short Description and ). The final closing bracket is prefixed as #KWD#).


The flow continues as shown in the table for all the arguments in a function that has multiple parts.

Example 2

RANK() over(order by COUNT(Incident_Number) desc) RANK

To run this function by using Advanced Authoring, type the following query in the SQL Query editor:

SELECT DBFN('rank;over;order by count',2,'#KWD#(','#KWD#)',1,'#KWD#(',5,'#KWD#(',`Incident Number`,'#KWD#)','#KWD#desc','#KWD#)') RANK FROM 'AR System Schema'.'HPD:Help Desk'

The following table describes how to interpret the DBFN functionality:

ArgumentDescription
rank;over;order by;countIndicates all parts in the function.
2Indicates number of arguments in the first part - (, and ).
The opening and closing brackets are prefixed with the string #KWD#. For example, #KWD#( and #KWD#).
1Indicates the number of arguments in the next part over, which has only one argument ( which is prefixed by #KWD#.
5Indicates the number of arguments in the next part order by, which has 5 arguments COUNT, (, Incident_Number, desc, and ). The opening and closing brackets are prefixed with the string #KWD#. For example, #KWD#( or #KWD#).


Was this page helpful? Yes No Submitting... Thank you

Comments