cancel
Showing results for 
Search instead for 
Did you mean: 

Using Variable in SAP HANA

Former Member
0 Kudos

Hi experts,

in the past I´ve been using Input Parameters a lot and I was very satisfied with stuff like Mapping them for filter push down and so on. Due the fact, that I´m using Cognos BI as a frontend, I switched to Variables, because the SQL synthax is easier to handle.

If I´m using the Variable on several fields and checking the Mandatory box, all works fine in the Data Preview of HANA Studio. The Calc View won´t show any data, if I do not fill out the prompt of the Variable.

If I´m using a SQL statement (SELECT *) within the editor on the corresponding Column View in SYS_BIC, the query is still running, although the VARIABLE is mandatory.

Is there a chance to assign the variable as mandatory without using the synthax $$VAR_XX$$ inside the Calc View?

Is there anything that needs to be considered? Data Source of the Calc View is an Analytic View.

Best regards, Christoph.

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member182546
Contributor
0 Kudos

Hi Christoph Rühle,

Kindly check the below video. Using variables in CDS view creation ( Parameterizing CDS views) (from SP8). Just check if the similar can be applied for your calculation views.

https://www.youtube.com/watch?v=i6wAkD6_Vsc

Thanks.

With Regards,

Sudhir S

0 Kudos

Hi,

Variable works like a where condition. When you check the variable as mandatory in your calculation view and run it, it just force to accept the value to run it. but in SQL statement when you run the query on corresponding column view without passing the variable it will just work without any where condition. SQL statement doesn't enforce to write the where condition in case of mandatory variable unlike you run it in graphical mode.

-

Subhash

Former Member
0 Kudos

There's a quick video which shows how to leverage variables and input params with Cognos here:

https://youtu.be/nm6sAg8gZ8E

HANA SQL will not enforce the mandatory property for variables. It will only do so for input parameters. It's only enforced for MDX access.