Hi Experts
I am trying to use scalar function which i created to remove leading zero and wanted to use it in conversion function under semantic node but I can not find this function when i search it.

CREATE FUNCTION "AKHATTI".Remove_Leading_Zero (im_Var1 NVARCHAR(20))
RETURNS result NVARCHAR(20)
LANGUAGE SQLSCRIPT
SQL SECURITY INVOKER AS
BEGIN
result := REPLACE(LTRIM(REPLACE(:im_Var1, '0', ' ')), ' ', '0');
END;
The function is working perfect when tested with Select query.
Also I read in another post that this can be achived by adding function in repository but not sure how to add this function to repository, need your help here.
Thank you.
Request clarification before answering.
You can follow the steps in tutorial Create a Scalar User-Defined Function to create a scalar function, which can be used as conversion function in a calc. view. Different from the tutorial you can create the function also without using a XS Project in the Eclipse based tooling. As you are using XS Classic, it is possible to add the function directly in the Eclipses based tooling via the Repositories view in the SAP HANA Development perspective or via the HANA web-based development workbench editor.
Please consider the restriction, mentioned in the documentation, which describes that conversion functions are not supported by SAP analytic client tools at the moment. E.g. SAP BusinessObjects Lumira or even the data preview in the modeling environment will not consider the conversion functions.
Regards,
Florian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Florian
As always appreciate for your time & help on this.
I was able to add scalar function into repository and now i can add same in semantic node but looks like it is not working in Analysis for office as mentioned by you, hopefully SAP will add this feature in future.
I have one more silly question just for my knowledge - I did above step in Dev system and when I tried to do in Quality I was not able to(as shown in screenshot)..Is this object can only be transported or something I missed in Quality.(I am doing lot of HANA modeling in Quality for some reason)
Thank you once again.

Not knowing your setup and not understanding the "some reasons" why modeling on QA is necessary :-), I would assume that you do not have the required package privileges (e.g. REPO.EDIT_NATIVE_OBJECTS, REPO.ACTIVATE_NATIVE_OBJECTS, REPO.MAINTAIN_NATIVE_PACKAGES in case of native objects/packages and/or REPO.EDIT_IMPORTED_OBJECTS, REPO.ACTIVATE_IMPORTED_OBJECTS, REPO.MAINTAIN_IMPORTED_PACKAGES in case of imported objects/packages).
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.