Setting a dynamic _as_of_date parameter

To set a dynamic _as_of_date parameter, you also need to set the Time Perspective global parameter.

About this task

The global parameter approach is sufficient for most use cases, but there are circumstances where additional user interactions are required. For example, many customers use data warehouses that load based on yesterday's data. When these customers run their reports today, they must manually select yesterday's date in the _as_of_date parameter to display any data. For such customers, using the dynamic _as_of_date parameter saves time and effort.

You can set any date you choose as the global parameter that Cognos® Analytics will remember. For example, you could set use yesterday or use last Sunday, which are common use cases.

The Gregorian calendar (Team content > Calendars > Gregorian calendar) includes the optional specification of the Time Perspective global parameter, which also employs the _as_of_date global parameter. When users run reports or dashboards that include the relative date filters and measures from the Gregorian calendar data module, they can customize these parameters for their needs.

Procedure

  1. Go to Manage > Customization, and select the Parameters tab.
  2. Click the Import link, and import the _as_of_date and Time Perspective parameters from the sample Global parameter date picker report. This report is located in Team content > Calendars > Tools.
  3. From the _as_of_date parameter context menu Vertical actions menu icon, click Properties.
  4. Optional: Specify a custom label for the parameter. To specify a language-specific label, next to Languages, click Set. You can also add a description of the parameter, or disable it.
  5. Select the Applied to all roles checkbox.

    When you select this property, all system and tenant user roles can use this parameter.

    If you are a Cognos Analytics on-premises user, and want to customize this parameter for specific roles, don't select the Applied to all roles checkbox. Instead, proceed to step 6.

  6. Customize the as_of_date parameter for specific roles in the following way:
    1. In Manage > People, select the Accounts tab.
    2. Locate the role for which you want to customize this parameter, and in the role Properties panel, select the Customization tab.
    3. Next to Parameters, click Settings.
    4. Select the checkbox next to the _as_of_date parameter that you specified in step 2.

      Click OK to finish setting this parameter without changing the default date, which is the current date. To set a specific date, select the Set values link, select the date, and click Apply.

  7. Repeat steps 3-6 for the Time Perspective parameter.
  8. Log out, and log back in.
  9. In theCognos Analytics welcome page, select the My parameters icon My parameters in the application bar.
  10. For the Time Perspective parameter, select a reference date from the drop-down menu, and click Apply
  11. Re-run the reports and dashboards that use relative dates.

Results

All users in the system or tenant can now see the My Parameters dialog box, and the _as_of_date and Time Perspective parameters are available to users when they run reports or dashboards that include the relative date filters and measures from the Gregorian calendar data module. You can customize these parameters. For more information, see Customizing the reference date.