Translating list menu labels

We shall create a label in cell A9 for the menu in B9. The label must change according to whether All, Product Group, Tire, or Size is selected from the menu.

We can use an IF statement to change the label according to the value that is held in the product level variable.

We can change the IF statement so that the label in A9 is translated if a user changes the report language.

  1. Each level of the hierarchy has a unique name. Create a list of the unique names in these cells:
    Cell Unique name
    B17 [Product].[All]
    B18 [Product].[Product Group]
    B19 [Product].[Tire]
    B20 [Product].[Size]
  2. Create this statement in A9:
    =IF(Variable.gv_ProductLevel2.Text=B17,"All",
    IF(Variable.gv_ProductLevel2.Text=B18,"Product Group",
    IF(Variable.gv_ProductLevel2.Text=B19,"Tire",
    IF(Variable.gv_ProductLevel2.Text=B20,"Size","NA"))))
    Note: If you created your own variable for the product level, replace references to gv_ProductLevel2 with the name of that variable.
    In View mode, the label in A9 changes according to the level of the Product hierarchy that is selected in the menu.
  3. To ensure that each label is translated, change the statement to:
    =IF(GlobalVariables.gv_ProductLevel2.Text=B17,TRANSLATEUNIQUESTRING("All"),
    IF(GlobalVariables.gv_ProductLevel2.Text=B18,TRANSLATEUNIQUESTRING("Product Group"),
    IF(GlobalVariables.gv_ProductLevel2.Text=B19,TRANSLATEUNIQUESTRING("Tire"),
    IF(GlobalVariables.gv_ProductLevel2.Text=B20,TRANSLATEUNIQUESTRING("Size"),"NA"))))
  4. Change the report language and check the results.
    Note: For a string to be translated, the string and its translations must exist in the Table of Names and Texts.
  5. Change the report language back to English.