Business Scenario: You have been asked to enhance an existing story with a dropdown to filter the Order Quantity table by product category.
To do this, you will add the following code to the story using the onIntitialization action:
123456var ProductABCratingList = TBL_Quantity.getDataSource().getMembers("0D_NW_PRID__0D_NW_PRCAT");
for (var i=0; i<ProductABCratingList.length; i++){
if (ProductABCratingList[i].id !== ""){
DD_Product_ABC_rating.addItem(ProductABCratingList[i].displayId, ProductABCratingList[i].description);
}
}You will also add the following code to the dropdown using the onSelect action:
1TBL_Quantity.getDataSource().setDimensionFilter("0D_NW_PRID__0D_NW_PRCAT", DD_Product_ABC_rating.getSelectedKey());This short video will walk you through the final story and scripting required.
Simulate the Steps
The practice exercise below simulates being in Advanced Mode in SAP Analytics Cloud and takes you through adding the scripting required to create the final story shown in the demo video.
Task Flow: In this practice exercise, you will:
- Add the dropdown to the story
- Add scripting to the onIntitialization action
- Add scripting to the onSelect action
- Test the scripting in the story










