O'Reilly logo

MDX Solutions: With Microsoft® SQL Server™ Analysis Services 2005 and Hyperion® Essbase, Second Edition by Francesco Civardi, Dylan Hai Huang, Christopher Webb, Sivakumar Harinath, George Spofford

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Appendix D. Format String Codes

Calculated members and cell calculations can specify the formatting applied to a cell value to transform it into a formatted value. The formatted value is a text string, whereas the raw value can be numeric or textual (and a numeric cell could represent a date or time serial number). This appendix lays out the codes specified by OLE DB for OLAP and used by Microsoft's OLAP, Analysis Services 2000, and Analysis Services 2005. The codes match the format arguments used by the Visual Basic Format() function.

Formatting Numeric Values

A format expression for numeric values can have from one to four sections, each section separated by semicolons. If the format argument contains one of the named numeric formats, only one section can be used. Table D-1 lists the section usage and interpretations of sections in format strings.

The following example has one section, and formats a number with two decimal places:

"#.00"

Table D-1. Format String Sections and Interpretations

SECTION USAGE

INTERPRETATION

One section

The format expression applies to all values.

Two sections

The first section applies to positive values and zeros, the second to negative values.

Three sections

The first section applies to positive values, the second to negative values, and the third to zeros.

Four sections

The first section applies to positive values, the second to negative values, the third to zeros, and the fourth to null values.

The following example has two sections. The first section defines the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required