cancel
Showing results for 
Search instead for 
Did you mean: 

HANA XSA - calculation view with dynamic filter

former_member356171
Participant
0 Kudos
322

Hi Team,

Is it feasible to use dynamic filters in HANA XSA graphical calculation views?

I am trying to pass the field name (Plant) and field value (IP_PLANT) dynamically to the calculation view filter expression as a where clause.

"PLANT" = '$$IP_PLANT$$'

Please help if that can be achieved using dynamic where condition & apply filter in graphical calculation view. I found few blogs for SQL script calculation views to handle dynamic filters but not for graphical.

Thanks,

Srilaxmi

Accepted Solutions (0)

Answers (1)

Answers (1)

fedaros
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Srilaxmi,

Just add to your test, a check if it is blank and it will work as a optional parameter.

("PLANT" = '$$IP_PLANT$$' or '$$IP_PLANT$$' = '')

HANA instantiator will exclude the plant filter in case the parameter has blank, as it's constant TRUE.

Regards, Fernando Da Rós

former_member356171
Participant
0 Kudos

Hi Fernando,

Thank you for the response, I'll consider the blank parameter check.

I am trying to achieve passing the field(PLANT) and the value($$IP_PLANT$$) dynamically to the calculation view.

As of now, I can pass the value dynamically in filter expression. Ex: "PLANT" = "$$IP_PLANT"

Is there any possibility to handle the dynamic where clause? similar to below

lv_whereclause = 'COLUMN = ''filter value''';
lt_result = APPLY_FILTER(ztest_table, :lv_whereclause);

Thanks,

Srilaxmi

fedaros
Product and Topic Expert
Product and Topic Expert

Hi Srilaxmi,

Yes you can do it but they have different purposes, the parameter you use inside graph calculation view can influence but maybe your output doesn't have the field you are filtering.

The option to you use APPLY_FILTER, and you can do if dynamically of course, it has a prereq you expose the field on output.

What to use depends on your scenario and your design decision.

Regards, Fernando Da Rós