Formatting data
The column data format specifies how column values are displayed in dashboards, stories, explorations, or reports. You can choose a format type such as text, percent, or currency.
Uploaded Microsoft Excel spreadsheets retain the column data formats that were defined in Excel. These formats are set as default data formats in the base data modules that are created from these spreadsheets.
Each format type contains properties that further specify how the data is displayed. Initially, the properties are set based on the format options that are returned from the source. If no option is returned from the source, the property is set to the data module default.
Some characters are language-sensitive and display properly only when your locale supports the applicable font. For example, for Japanese currency symbols to display correctly, your locale must be set to Japanese.
About this task
In a data module, you can format data by using the basic formatting options and advanced formatting options.
Basic data formats can be viewed on the Grid tab in the data module, and in reports, dashboards, stories, and explorations which use this data module as their data source. However, the advanced options are supported only in Reporting.
For example,
to display the date 2024-1-15 as 2024/01, the
following advanced data formats can be specified for a Date
column in the data
module:
The following table shows how the date formatted this way is displayed in the different Cognos® Analytics UIs:
UI | Date display |
---|---|
The data preview (the Grid tab) in a data module | 2024/1/15 |
Dashboards | 2024/1/15 |
Stories | 2024/1/15 |
Explorations | 2024/1/15 |
Reports | 2024/01 |
As you can see, only Reporting supports the advanced data formatting options that were specified in the data module.
If you require the advanced formatting options for your data in dashboards, explorations, or stories, ensure that the data already exists in the format you require in the data source (database, Excel spreadsheet). You can also use various Cognos Analytics functions to format the data. For example, to produce the output 2024/01, you can use the following function:
cast(YEAR(DAY_DATE), char(4)) || '/' || cast(RIGHT('0' + RTRIM(MONTH(DAY_DATE)), 2), char(2))