Examples of caption expressions that use different combinations of variables and static text are shown below. Examples are shown for all types of measure items -- regular with time ranges, regular without time ranges, and calculated. Caption expressions can include a combination of the following elements or just one of these elements, whatever your preference:
Variables that specify the type of data to return such as the name of the underlying measure, the long description of the From and To periods for time ranges, or the name and description of conditional formats applied to the measure items. Stratum.Viewer evaluates the variables when you run a view and pulls in the proper data from the most current data in Analysis Services database on which the view was built.
Static text that remains the same each time the view is executed.
Line breaks that place different parts of the caption on separate lines. If you don't use line breaks, only text wrapping will control the caption display. Line wrapping updates automatically as the size of the grid area or browser changes.
Here are the properties for a measure item with a time range. The measure item is based on the Daily Sales Daily Sales Amount measure from the Daily Sales category.
Here are some examples of caption expressions that were set up for the measure item and what each executed caption looked like in the view. In these examples, the current year is 2014 and the current month is September. The time elements in the evaluated captions reflect that current state of the data. Variables are the parts of the expressions that have brackets [ ] around them.
Builds Caption with... |
Example Expression & Caption |
Variables for measure, short description of periods, and short format for year (separated by spaces and static text) |
Expression [Measure] [From Period Short Desc] [From Year YY] to [To Period Short Desc] [To Year YY] Caption in View |
Variables for measure, long description of periods, and long format for years (separated by spaces and static text) |
Expression [Measure] [From Period Long Desc] [From Year YYYY] to [To Period Long Desc] [To Year YYYY] Caption in View |
Variable for category and measures (separated by spaces and static text) |
Expression [Category] - YTD [Measure] Caption in View |
Static text, line breaks, and variable for measure |
Expression Current YTD Caption in View |
Here are the properties for a measure item without time ranges. This measure item also is based on the Daily Sales Daily Sales Amount measure from the Daily Sales category.
Next are some examples of caption expressions that were set up for the measure item and what each executed caption looked like in the view. Variables are the parts of the expressions that have brackets [ ] around them.
Builds Caption with... |
Example Expression & Caption |
Variable for measure |
Expression [Measure] Caption in View |
Variable for category and static text |
Expression [Category] Amount $ Caption in View |
Variable for category, line break, and static text |
Expression [Category] Caption in View |
Here is the expression for a calculated measure item that was added to the view from the prior example and that calculates the percent of total.
Next are two examples of caption expressions that were set up for the measure item and what each executed caption looked like in the view.
Builds Caption with... |
Example Expression & Caption |
Static text without line break |
Expression % of Total Daily Sales Caption in View |
Static text with line breaks |
Expression % Caption in View |
Here is the same calculated measure item with a conditional format applied to it. The conditional format is named Track Below 5% and it displays a yellow arrow when percent of total is below 5%. The next example shows the grid after edits were made to the caption expression, including using the Conditional Format Name variable in the expression.
Builds Caption with... |
Example Expression & Caption |
Variable for conditional format name |
Expression % Total - [Conditional Format Name] Caption in View |