on 2023 Apr 24 5:13 PM
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
Request clarification before answering.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
User | Count |
---|---|
88 | |
10 | |
9 | |
8 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.