Implementing SQL in Calculation Views
Expressions in calculation views are written in SQL. You write expressions in:
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.