Skip to main content
Hitachi Vantara Lumada and Pentaho Documentation

Calculated Dates

This task is only useful for result sets that contain date information.

The formula described here will provide a calculated date in a report. Typically you would display a date as a static number or a range, but the process explained below will enable you to display specific dates like "the first Monday of the month" or "every second Wednesday."

  1. Open an existing report or create a new report and establish a data source and query, then drag your data-driven fields onto the canvas.
  2. Select (left click) the text field you want to print the calculated date in; if you do not have a text field dedicated to this task, create one now.
  3. Click the Structure tab and click value in the common section under the Attributes tab.
  4. Click the round green + (Add Expression) icon in the Formula column. The Expression dialogue will appear.
  5. Click the ellipsis (...) to open the Formula Editor dialog box.
  6. Select Date/Time from the Category drop-down box.
  7. Double-click the DATEVALUE item in the list on the left.
  8. Enter in your DATEVALUE formula, then click OK. For more information on DATEVALUE's parameters, see the OASIS reference page for DATEVALUE: and VALUE: Alternatively you can consult the examples below and modify them for your purposes.
  9. Click Close to exit the Expression dialog box.
  10. Click Preview and verify that your date values are properly calculated and formatted. You may have to adjust your query if it does not produce a testable result set.

The date values you specified should now appear correctly in your report.

Some common calculated date formulas:

1st day of current month
Sunday of current week
Saturday of current week
Current day, date, and time
Current date
Yesterday's date