Scripting Code Snippet
Scripting Code Snippet
Scripting Code Snippet
IF ELSE
if (condition) {
} else {
2. SWITCH
var selectedCountry = Dropdown1.getSelectedText();
switch (selectedCountry) {
case "Germany":
break;
case "USA":
break;
default:
3. FOR--: to log all hierarchies from data source to console with FOR
var Hierarchies = TBL_Quantity.getDataSource().getHierarchies("0D_NW_PRID");
}
4. WHILE--: to log all hierarchies from data source to console with WHILE
var Hierarchies = TBL_Quantity.getDataSource().getHierarchies("0D_NW_PRID");
var x = 0;
x++;
TILE 1 :
TS_Content.setVisible(true);
TS_Content.setSelectedKey("Tab_1");
TILE2 :
TS_Content.setVisible(true);
TS_Content.setSelectedKey("Tab_2");
6. ARRAY
Arrays are identified by [ ] as shown in the previous example above and can be:
- Printed to console
console.log(resultset);
console.log(resultset[x]["@MeasureDimension"].rawValue);
console.log(resultset[1]);
Dropdown_1.addItem(country.id, country.description);
8. return an array of all charts in your story with a name starting with "CH_Tile"
console.log (tilecharts);
9. to enhance an existing story with a dropdown to filter the Order Quantity table by
product category
var ProductABCratingList =
TBL_Quantity.getDataSource().getMembers("0D_NW_PRID__0D_NW_PRCAT");
DD_Product_ABC_rating.addItem(ProductABCratingList[i].displayId,
ProductABCratingList[i].description);
TBL_Quantity.getDataSource().setDimensionFilter("0D_NW_PRID__0D_NW_PRCAT",
DD_Product_ABC_rating.getSelectedKey());