Editing a Variable

Modifies a regular or grouping variable from the variable dictionary of a Web Intelligence document.

You can change the qualification, name or definition of a regular variable. You can change the groups and group values of a grouping variable.

Request

PUT <webiURL>/documents/{documentId}/variables/{variableId}

Where:

  • {documentId}: the identifier of the Web Intelligence document retrieved from the list of documents
  • {variableId}: the identifier of the variable retrieved from the list of variables

Request body in the case of a regular variable:

<variable qualification="Measure|Attribute|Dimension">
    <name>
    <definition>
Remember The regular variables must adhere to the following rules:
  • The formula must be valid.
  • When you change the definition of the variable, you must refresh the document to commit your change to the report.

Request body in the case of a grouping variable:

<variable grouping="true">
    <groups>
        <group>
            <name>
            <values>
                <value>
Remember The grouping variables must adhere to the following rules:
  • The grouping attribute must be present and set to true.
  • The <dimensionId> element is not required.
  • Only one group can have the ungroupedValues attribute. Values assigned to the ungroupedValues group are ignored.
  • A group must have a name and contain at least one value, except the ungroupedValues group.
  • A value can be assigned to only one group and must belong to the parent list of values.
Response

Response type: application/xml or application/json

The response is a message stating the success or failure of the request.

Example

Regular Variable

PUT <webiURL>/documents/8022/variables/L9

Request body:

<variable qualification="Measure">
    <name>Updated variable</name>
    <definition>=[RevenueThreshold]*[Threshold factor]/10</definition>
</variable>

Response:

<success>
    <message>The resource of type 'Variable' with identifier 'L9' has been successfully updated.</message>
    <id>L9</id>
</success>

Example

Grouping Variable

PUT <webiURL>/documents/6409/variables/L1

Request body:

<variable grouping="true">
    <groups>
        <group>
            <name>First Semester</name>
            <values>
                <value>1</value>
                <value>2</value>
                <value>3</value>
                <value>4</value>
                <value>5</value>
                <value>6</value>
            </values>
        </group>
        <group>
            <name>Second Semester</name>
            <values>
                <value>7</value>
                <value>8</value>
                <value>9</value>
                <value>10</value>
                <value>11</value>
                <value>12</value>
            </values>
        </group>
    </groups>
</variable

Response:

<success>
    <message>The resource of type 'Variable' with identifier 'L1' has been successfully updated.</message>
    <id>L1</id>
</success>