The restricted column is one of the column types available in SAP HANA Cloud models, which include the following:
The restricted column is restricted based on one or more attributes. These columns can be anything in the base table or view that the modeler defines to help reporting or further modeling.
The restriction criteria cannot be based on a column defined as a Measure in the semantics. Only columns of type Attribute can be used.
Example Without Using a Restricted Column
With this data, you could restrict your report by filtering by Cost Type = Shipping Cost. If your reporting tool is SAP Business Objects, you could create a data provider with a query restriction where Cost Type is filtered to only display Shipping Cost.
Creating Restricted Columns
Setting the Restriction
Continuing with the example of using SAP Business Objects for reporting, when you have access to this restricted column, you can report on both the total gross amount and the gross amount for flat screens, in the same data provider or query.
If there are different lines in the restriction, all the lines defined on the same column are combined with the logical operator OR, and then, all the sets of restrictions for different columns are combined with the logical operator AND.
This is the case regardless of the order in which you define the lines.
Displaying and Editing Restriction Expressions
Another option to define or edit the restrictions is to use an Expression. This provides more flexibility when the standard operators for the column-based, "graphical", restrictions do not fulfill your needs. The expression can use column names, operators, input parameters. From SAP HANA 2.0 SPS05 onwards, the restricted column expression can also include Functions.
You can visualize the expression corresponding to your restrictions. This can be useful, for example, when you want to check the precedence of logical operators.
It is also possible to modify this expression, especially in complex scenarios when the features offered in the Column tab do not fulfill your requirements.
The expression can be written using SQL, in addition to the Column Engine syntax. However, for expressions in SQL, SAP HANA Cloud modeling supports a limited list of SQL functions.
The general SQL support within expressions is not specific to restricted measure expressions. SQL can also be used in the following expressions:
Default values for variables and input parameters
You will learn about these different types of modeling functions later.