on 2023 Mar 27 10:09 AM
Tutorials: https://developers.sap.com/tutorials/hana-cloud-create-cube-calculation-view.html
--------------------------
Hi, is there a way to create the Calculation View by HANA SQL, like CREATE CALCULATION SCENARIO ...? Thanks Frank
Hi Frank,
calculation views are intended to be created in a graphical environment: SAP Business Application Studio with SAP HANA Cloud, SAP Web IDE on premise. Within the graphical calculation views you can include table functions.
If you really want to deploy calculation views via SQL then your challenge will be to get the corresponding XML first. If you have the XML that describes the calculation view (e.g., by opening the file in text-mode in Business Application Studio) you can deploy it via SQL within an HDI environment.
Best,
Jan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Frank,
I think for the tests the following approach will work for you (not supported by sap, etc, etc):
1. Find the runtime object of the example view. I think the easiest would be: something like select * from views where view_name = <your view>.
2. you can extract the create statement there, it is s plain text JSON string. Should look something like '{create column view...<...>}'
3. you should be able to execute this statement from step 2 in target environment.
Optionally you can make simple modifications before step 3: like change the view name, or target schema, etc.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, that’s what I did. The only problem was, that the Cube is not created. Creation via the SQL run through without any error. When opening the objects in the Database Explorer, you see two entries for each Calculation View with the same name, one in Column Views and one in Cube. The one in Cube is missing for my SQL based Calculation View.
frank.albrecht,
To add further context to yoganandamuthaiah's feedback, creating Calculation Views with HANA SQL used to be a feature known as "Scripted Calculation Views" and has been deprecated in favour of Graphical Calculation Views as described in Convert Script-based Calculation Views to Graphical Calculation Views. If you still need some form of scripting logic then you can create Table Functions and access them in Graphical Calculation Views as described in Table Functions in SAP HANA – step by step guide.
Regards,
Mustafa.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
that is called table function, I think.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi jun.wu5,
I guess you mean the use of table functions for cases where graphical calculation view modelling doesn't address requirements, as described in this discussion.
Regards,
Mustafa.
frank.albrecht
No, it is not possible to create a Calculation View using HANA SQL. Calculation Views are created using graphical tools in the SAP HANA Modeler perspective of the SAP HANA Studio.
No, SQL statements such as CREATE CALCULATION SCENARIO are not supported. Calculation views can only be created using the SAP HANA Studio or the SAP HANA Web-based Development Workbench.
If this response answers your query, please accept it and close the thread 🙂
Have a wonderful day!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What about using Business Application Studio to model Calculation Views?
yes mbensan, through SAP BAS works as well !
User | Count |
---|---|
69 | |
11 | |
11 | |
10 | |
9 | |
8 | |
7 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.