MicroStrategy ONE

Adding dynamic data to a document

A data field is a text field that contains a reference to an object (metric, attribute, consolidation, or custom group) on a report. When you view the document as a PDF, the data fields are replaced by the actual data.

The reference in a data field is the object name inside braces { }. The braces indicate that the text fields are data fields, not static text. In Design Mode, data fields for the Employee attribute and the Revenue metric look like the following:

When the document is executed, all data fields are automatically populated from a dataset with data that originated in the data warehouse (or an Intelligence Server cache).

When the data fields shown above are displayed in PDF View, the attribute elements and revenue values are displayed, as shown below:

If the object referenced by a data field is removed from the dataset, the data field will become static text when the PDF is created.

The value of a metric, whether it is created in the document or is a dataset object, is calculated differently depending on its location in the document, as described in Metric calculation in document sections.

You can add data fields in any of the following ways:

  • Drag and drop a dataset object onto any section of the Layout area. A text field containing a reference to the dataset object is added to the document. For example, if you drag Year, Category, and Subcategory to the Detail section, near the Revenue metric that you added before, it looks like this:

    When you view the document as a PDF, the result looks like this:

  • Drag and drop a specific attribute form into any section of the Layout area. Many attributes have both an ID and description. In the document sample below, Item is displayed in two attribute forms: ID, which is listed in the SKU column, and Description.

    To display a particular attribute form, expand the attribute in the Dataset Objects panel. Drag and drop the desired attribute form into the Layout area. The format of the data field is attribute@attribute_form. See the following image, which generated the document sample above.

  • Insert a blank text field in any section of the Layout area, then type the reference to the dataset object in the text field.

  • Create a metric within the document, which creates a text field containing a reference to the metric. For details, see Creating metrics in documents.

To add a text field to a document

  1. In MicroStrategy Web, open the document in Design Mode.

  2. Add a text field using one of the following methods depending on your goal for the text field:

    • To create a static label, type text:

      1. From the Insert menu, select Text. A blank text field is inserted.

      2. Type the static text.

      3. Press Enter.

    • To create dynamic text, drag and drop a dataset object:

      1. From the objects displayed in Dataset Objects, select the object you want to use.

      2. Drag and drop the selected object into the Layout area.

    • If an object name contains special characters, the text field is automatically placed within square brackets [ ] when you drop it in the Layout area. This ensures that data fields are resolved correctly when the PDF is displayed in a language other than English. A special character is any character other than a - z, A - Z, 0 - 9, #, _, and . (period).

      When you add a metric to the document, the dataset name is added to the string if the metric exists in multiple datasets.

    • To create dynamic text, type the data field manually:

      1. From the Insert menu, select Text. A blank text field is inserted.

      2. Type the object's name within braces, such as {Revenue} or {Region}. The name must match either the name of an object in a dataset or its alias. If either name contains spaces or special characters, you must type it in square brackets [ ] within the braces, as in {[Last Year Revenue]}. A special character is any character other than a-z, A-Z, 0-9, #, _, and . (period).

      3. To display a particular attribute form, type @ attribute_form after the object name, within braces, where attribute_form is the name of the attribute form to be displayed. If you specify an attribute form that does not exist for an attribute, the data field cannot be resolved and the syntax is displayed as text in the PDF.

      4. If a metric exists in multiple datasets, use the syntax {[dataset name]:[object name]}. Do not associate an attribute with a specific dataset, as attribute elements come from the joined datasets.

      Press Enter.

  3. To resize the text field, click and drag the field.

    The text field is automatically formatted in the default style for the text field control type. To change the formatting, right-click the text field and select Properties and Formatting. For details to format the text field, see Formatting text fields.

    If you want a user to be able to click a piece of text and go to a web page, you can define the text field as a link. For details, see Linking to a web page.