Using the Wrangling Expression Language (WEL)

Open the Custom Expression Editor and access the Wrangling Expression Language to define your own transformations using predefined functions and a scripting editor for specific wrangling capabilities.

Once your dataset is created, you need to model your data for further needs. SAP Analytics cloud offers a large range of tools to help you transforming your data. However, it might be that the available transforms do not cover all your needs. In such cases, accessing the Wrangling Expression Language and define your own transformations using this language tool is the solution:
  1. Open the Custom Expression Editor located in the Action toolbar.

  2. Type in a custom expression directly or use keyboard shortcuts to build an expression.
Note
Refer the Custom Expression Help panel to get detailed description, syntax, and examples for each of the available functions.
The expressions are grouped into 5 types:
  • Numeric Functions let you work with numerical values.
    Example
    Your dataset contains information on 30 years and you want to group the years into bin of 5 years. Use binByBinWidth : [column] = binByBinWidth([Year],5).
  • String Functions let you work with text values.
    Example
    You have a large dataset containing data on key social and economic indicators in the United States. You want to see only the tax indicator: Use startsWith and filter on strings starting with "Tax":[column] = startsWith(indicator Name, 'Tax').
  • Date & Time Functions let you work with date and time values.
    Example
    You want to calculate the difference in months between two dates. Use dateDiff: [column] = dateDiff(2016, 2020, 'month').
  • Spatial Functions let you work with spatial values.
    Example
    You want to calculate the distance between two locations, based on specified latitudes and longitudes. Use distance: [column] = distance(latitude_1, longitude_1, latitude_2, longitude_2).
  • Other Functions
    Example
    You want to add unique row numbers to each row of your dataset, which can be used to see individual measures instead of aggregated ones in your story. Use rowNumber: [Row Number] = rowNumber(). A new dimension containing the row numbers is added to your dataset.
    Note
    Row number can be different between sample and full data or depending on data refreshes. Moreover, if later you use a transformation that duplicates rows, this can result in duplication of row numbers as well.
Each time you create a custom expression, a transform log is created. Using this log, you can edit your expression as many times as you want.
Note
You access the transform log clicking the button Transform Log.