Define a custom query

You can define database-specific queries in the execution plan that only execute for a specific database type such as SQL Server or Oracle.

  1. In your execution plan, click Add Add icon.
  2. Select Add SQL query from the list.
  3. Define the data source and enter your query.
    You can use <FromDate>, <ToDate>: These parameters define the data load interval.
    If the execution plan is triggered from the Viewer, you can use the following parameters.
    • <FromDate>, <ToDate>: Define the time interval from the dashboard.
    • <UserProperties::Login>: Define the login of the authorized user. This property can be used only with the Insight user authentication.
    • <Property::ParameterName>: Define the value of the ParameterName from the parameter driver on the dashboard.
    • <Dimension>: Define the selected dimension value from the dashboard.

    For example, the SQL query may look like the following.

    INSERT INTO [Actions]
    ([Action]
    ,[User]
    ,[Comment]
    ,[Time]
    ,[ReassignUser]
    ,[InvoiceId])
    VALUES
    ('Reassign'
    ,<UserProperties::Login>
    ,<Properties::ActionComment>
    ,<Properties::ActionComment>
    ,GETDATE()
    ,<User>
    ,<AnalyticsInvoiceId>);
    
  4. In the Property Panel, select the Database Type.

    To run the SQL query successfully, the database type in the Property Panel must match the type selected for the corresponding data source in the Data Sources window.

  5. Click Save Save.