Using Hidden Fields in Reports


When creating a report in WebFOCUS Designer, you can hide a field so that it exists in the report but is not shown as a column. The main advantage of doing this is that hidden fields are still used for sorting, which gives you more control over how the values in a report are displayed and organized. To hide a field in your report, right-click a field and click Hide. The hidden field appears slightly faded in its bucket, as shown in the following image.


Hidden fields in buckets

You can display the field again by right-clicking it and de-selecting the Hide option.

You can sort by hidden dimension fields if you do not want them to display in the chart, but still want to use the values in those fields to sort the values in the fields that do display.

The following image shows a report sorted by Sale Day Name and Sale Date. We want to see sales information based on the day of the week. Notice, however, that Sale Day Name is sorted alphabetically, by default.


report sorted by day name, but it's alphanumeric!

We can add the Sale Day of Week field, which assigns a number to each day, to the report as the primary sort field, and then hide it so that the days are listed in order, as shown in the following image.


Report with days sorted into order

A hidden field is also created automatically when you sort by a measure field. To sort by aggregated measure values, right-click a measure field in the Sum bucket and click Sort ascending or Sort descending. A hidden instance of the measure field is added to the top of the Rows bucket, as shown in the following image.


The result is a report that is sorted into rows based on the selected measure value, as shown in the following image.


report sorted by profit

In this example, sorting by Gross Profit has allowed us to see at a glance that larger profits have been made in more recent years. You could change the sort order to see lowest profits first by clicking the sort arrow for the hidden Gross Profit field in the Rows bucket, just as you could for a visible field.

You can move this hidden field in relation to the other sort fields to change the sorting priority. In the following image, the hidden Gross Profit field has been moved to after Sale Year, allowing us to see the most profitable products in each year, as shown in the following image.


report sorted by year then by profit

You can sort by multiple measures to have more granular control over how the report is sorted. If there are some matching values of the first sorting measure, then the second sorting measure will be used as a secondary means of determining sort order.

When using the Details display option instead of the Sum option, you can sort fields in the Details bucket in the same way. This can be helpful if you want to view a sorted list of all records for a field. Right-click a field in the Detail bucket and click Sort ascending or Sort descending to sort the report using the values from that field.

You can remove the sorting effect of a field in the Summaries or Details bucket by pointing to the invisible measure field in the Rows bucket and clicking the X, or by right-clicking the original field in the Summaries or Details bucket and clicking No sort. The hidden field is removed from the Rows bucket, but the original field remains in the Summaries or Details bucket. When you remove the original field from the Summaries or Details bucket, the invisible field in the Rows bucket is automatically removed as well.