Implementing SQL in Calculation Views

Objectives
After completing this lesson, you will be able to:

After completing this lesson, you will be able to:

  • Implement SQL in a calculation view

SQL Expressions in Calculation Views

Expressions in calculation views are written in SQL. You write expressions in:

  • Calculated columns

  • Filters

  • Restricted columns

In addition, SQL can be used to generate values for input parameters. For example, SQL can determine the top 5 customers of the current month and pass these to the input parameter of the calculation view to be used as a filter. This is very powerful feature because input parameters are used throughout calculation views to provide dynamic values to filters, ranking thresholds, pre-filling user prompts, calculations, and so on.

One of the key benefits of using SQL is that it provides a long list of ready-made functions. These functions can provide significant additional options when you are trying to develop some logic where data must be manipulated. For example, SQL provides many string manipulation functions that are useful for re-formatting a field, or extracting some characters from it. Also, there are many predefined functions available that can help you to calculate using dates. For example, to find the number of days between two dates.

Note
SQL expressions in calculation views uses plain SQL and not the syntax of the SAP enhanced version, SQLScript.

Save progress to your learning plan by logging in or creating an account

Login or Register