Restricted & Calculated Measures in S/4 HANA Cloud Custom Analytical Queries(In-app extensibility)
In S/4 HANA cloud Custom Analytical Queries are used to build reports. Here in this blog we will talk about Restricted & Calculated measures and how those can be used. Let’s talk about a simple example to illustrate the use of these measures. For example, we need a report for financial reporting which includes –
- Company Code (Dimension)
- Ledger (Dimension)
- G/L Account (Dimension)
- Current Year Total In Company Code currency (Measure)
- Previous Year Total In Company Code currency (Measure)
- Total In Company Code currency (Measure)
Since “Amount In Company code currency” from standard CDS view Accounting Journal Entry Item Cube(I_JournalEntryItemCube) will contain line items with values from all previous years and the current year we can use restricted & calculated measures to get these values.
- Create a Query with source I_JournalEntryItemCube.
- Select required fields.
- In order to remove a field from the output display simply uncheck the display box.
- Select Add option and click on Add Restricted Measures.
- Create a restricted measure, in this case, we need to restrict by dimension Fiscal Year.
- You may also create a User Input Filter, for user selection.
- We similarly create one for previous year and a similar measure to restrict values for previous year.
- Now create a Calculated measure to add the two measures just defined.Edit expression to SUM the values based on G/L Account.
- Final Output –
I´m trying to create a Calculated Measure like this:
A - B
But some times A is negative and the result is not correctly.
How make this if A and B can be negative any time.