Creating Expressions for Captions

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:

Measure Items with Time Ranges

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.

creatingcaptions1.png

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

creatingcaptions2.png

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

creatingcaptions3.png

Variable for category and measures (separated by spaces and static text)

Expression

[Category] - YTD [Measure]

Caption in View

creatingcaptions4.png

Static text, line breaks, and variable for measure

Expression

Current YTD
Months
[Measure]

Caption in View

creatingcaptions5.png

Measure Items without Time Ranges

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.

creatingcaptions6.png

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

creatingcaptions7.png

Variable for category and static text

Expression

[Category] Amount $

Caption in View

creatingcaptions8.png

Variable for category, line break, and static text

Expression

[Category]
Amount $

Caption in View

creatingcaptions9.png

Calculated Measure Items

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.

creatingcaptions10.png

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

creatingcaptions11.png

Static text with line breaks

Expression

%
of Total
Daily Sales

Caption in View

creatingcaptions12.png

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

creatingcaptions13.png