WBA

Writes values to an attribute table (if supported by the database). You cannot write back to intrinsic values.

See intrinsic attributes.

Syntax

=WBA(Value,"Database Alias","Cube","Hierarchy Name","Attribute Name",
"Element Name")

The first argument of the formula is the value to write to the attribute table. The last argument is the element to accept the value. Both arguments can be replaced by cell references.

Example

This example uses the Tutor sample database. The Best Practices Templates sample database is not suitable because amending the values of its attribute tables is not allowed.

In this example, you write a value to the Product Manager attribute (ATT1_PRODMAN) of the Products dimension.

You cannot write back a value in the cell containing the WBA function. Instead, you enter the values in an unprotected blank cell and reference that cell in the formula.

  1. Drag the Tutor database alias from the Database Structure pane into cell B2.
  2. Drag the TotSales cube from the Database Structure pane into cell B3.
  3. In cell B8, specify =WBA(G8,B2,B3,"[Products]","ATT1_PRODMAN","[products].[total].[total monitors]")
  4. Remove cell protection from cell G8

    See Applying cell protection.

  5. In Design Mode, specify a text value in G8 and press Enter.
  6. In View Mode, specify a text value in cell G8 and press Enter.

The value which you specify is written to the ATT1_PRODMAN attribute. The formula in cell B8 displays the value which you specified.

Note: You can use the WBA formula in an Edited Cell action. The changed attribute will then be written back when it is entered in the cell.

Example

The Products hierarchy of the Tutor sample database has an attribute table called ATT1_PRODMAN. The name of the product manager for each product is stored as an attribute. This example uses the WBA function in an Edited Cell action to update the attribute table.

This example uses the Tutor sample database. The Best Practices Templates sample database is not suitable because amending the values of its attribute tables is not allowed.

  1. Drag the Tutor database alias from the Database Structure pane into cell B2.
  2. Drag the TotSales cube from the Database Structure pane into cell B3.
  3. Select cells B6 to D6.
  4. Drag the Products dimension from the Database Structure into cell B6 to create a vertical hyperblock.
  5. Click cell C6 and click Edit OLAP Formula in the Objects toolbar.
  6. Select Attributes as the formula type, Tutor as the database alias, TotSales as the cube, Products as the dimension, and hierarchy, ATT1_PRODMAN as the attribute and Selection of a variable from the Element list. The Contextual Selection of Objects dialog is displayed. Select $B$6
  7. Create a report variable called rv_temp.
  8. Right-click cell D6 and select Define Action.
  9. Select Set parameters as the action type and Edited cell as the action mode.
  10. In the Parameters section of the Define Action dialog, double-click <New parameter> and select rv_temp.
  11. Specify this formula as the value of the parameter: =WBA(D6,B2,B3,"[Products]","ATT1_PRODMAN",B6)
  12. Remove cell protection from cell D6.
  13. In View Mode, specify a text value in cell D6 and press Enter.
  14. Press F9 to refresh the report.

The values which you specify are written to the ATT1_PRODMAN attribute.