cancel
Showing results for 
Search instead for 
Did you mean: 

How to make Input Parameter optional in sap hana

former_member258682
Participant
0 Kudos

Hi folks,

I wanted to make input parameter optional i.e.

if I do not give any value in input parameter or if I give '0' then it should give all the rows corresponding to that column.

I tried to achieve this by applying filter expression:

if('$$input_param$$'='' or isnull('$$input_param$$')=1,"column_name",'$$inputparam$$')


But it is giving column store error.

Eagerly waiting for your replies.

Thank you!

Accepted Solutions (1)

Accepted Solutions (1)

pfefferf
Active Contributor

Hello Sarthak,

please can you post the exact error message.

Things which can be seen from your code snippet:

  • You have used two different names for the input parameter (one with underscore the other w/o underscore). I think it should be the same name.
  • You said that you used that snippet in a filter expression. Therefore you have to provide a comparison in the If/Else case. Just using a "column_name" or the input parameter value will the filter expression not let know against which value you wanna compare the filter value. An expression for a filter against a column "column_name" would look like following for instance:
    if(isnull('$$input_param$$') or '$$input_param$$' = '', match("column_name",'*'), "column_name" = '$$input_param$$' )

Regards,

Florian

former_member258682
Participant
0 Kudos

Thank you so much, it worked

former_member258682
Participant
0 Kudos

Can u please provide any link for the match function I could not find it anywhere.

pfefferf
Active Contributor
0 Kudos

"match" is the "contains pattern" filter operator. A "little" doc can be found here: Supported Operators for Filters - SAP HANA Modeling Guide for SAP HANA Web Workbench - SAP Library

Answers (0)