Mandalay CS 3.2Creating Reports for Mandalay CS3 in WBRAdvancedHow to show a time column as an hour of the day in a report using Complex Expressions

How to show a time column as an hour of the day in a report using Complex Expressions

These instructions are on how to use complex expressions to format a time so that it displays as the hour of the day.

Add new column to report

Add new column to report

Click on the Add Column button to add a new column to the report. This column will then be configured as a complex expression column.

Change to complete expression

Change to complete expression

Check the Exp check box to change to complex expression mode for this column.

Enter expression

Enter expression

Click on the Column data. In this case the term SiteID.

Type in the following expression : DATENAME(hh,DateOut)

It is possible to add additional test to the output. So if you wanted to display ':00' at the end so the result was 13:00 for 1pm then you can add " + ':00' " after the DateName function so result will look like a time.

See here for more information on the usage of the DATENAME function.

Note: The DateOut column can be replaced with any Date field available in the WBR views (e.g. DateIn)

Set Alias

Set Alias

All complex expressions must have an Alias, so click on Alias box and enter in a name for the column.

Note: An alias name for a complex expression can only be used in one custom report per view otherwise the sample data view will no longer work.

Preview report

Preview report

Click on the preview button to see the result of the new column

Results

Results

The results of adding this columns to a report

Grouping

It is not possible to group on these complex expressions. Any additional data manipulation should be performed outside WBR (i.e Excel)

Exporting Data

Exporting Data

View the report and then click on Export to Excel so the data can be adjusted as required.

Note: It is not possible to use the generate raw data that includes the complex expression as this is not considered raw data.