Translating list menu labels

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

We will use an IF statement to change the label according to the value held in the gv_ProductLevel2 variable.

Then, we will amend the IF statement so that the label in A9 is translated if a user changes the report language.

  1. Create a list of the unique names of the different levels of the hierarchy in these cells:
    Cell Unique name
    B17 [Product].[All]
    B18 [Product].[Product Group]
    B19 [Product].[Tire]
    B20 [Product].[Size]
    Note: The case in which you specify the unique names in cells B17 to B20 must match the case used to specify the values in 'Using actions to structure the product list'.
  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"))))
    In Report Mode, the label in A9 changes according to the level of the Product hierarchy 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 to German 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.