How to use UDF in graphical calculation view ? Which schema and what sort of permission will i need for aforesaid?
Be more specific about your question. What problem are you facing? What HANA version are you using? What documentation have you checked?
I have the same question: How to use a scalar function in a calculated column in a calculation view.
Background: I need the function IS_NUMERIC in a calculated column. So I created a scalar function IS_NUMERIC.
I know how to use it in SQL:
"SCHEMA"."package::IS_NUMERIC"("columnToCheck")
But unfortunately the calculation view gets not activated using the above code in a calculated column.
Scalar UDFs are not supported in the expression editor for calculated columns.
One way to get that sort of functionality into the graphical editor is to encapsulate it into table typed UDFs.
Where you can use scalar functions with graphical calc views is the parameter conversion functions and the input parameter defaults.
Thx for sharing Lars. This is - again - very sad. This makes Graphical Calculation views not possible in many cases. Putting a Calculation view on top of a Table function is only beneficial in some cases.
If your parameter was actually a date-data type, then users could only enter valid dates.
So, I assume that’s not the case here. Maybe your data model uses the NetWeaver DATS implementation, which stores dates in NVARCHAR(8) on HANA, If that’s the case, you can use the DATS_IS_VALID() built in function.
As stated by Lars Breddemann it is not possible to use a Scalar Function in a graphical calculation view :/
Workaround is to use it in a Table Function.
A Table function can be used in a graphical calculation view.
I myself do sometimes mix Table Functions and Graphical Calculation Views. But many times a Graphical Calculation View is not needed any more after you have to use a table function any way.
I am using SAP HANA 11. I have created something similar to ISDATE function to check whether a string is a valid date. I want to use this function to check input parameter is a valid date or not.
You will mention the schema when creating the function: CREATE FUNCTION <schema>.<function>. You will need 'execute' on the schema where the function is created.
Try the 'conversion function' option in the input parameter creation screen. That should work for you. But you might not be able to throw error message etc if the user enters a wrong date format.