cancel
Showing results for 
Search instead for 
Did you mean: 

REPLACE_REGEXPR function in Hana

former_member216748
Participant
0 Kudos

Hello Experts,

Below is the logic for regexp_replace from source DB.

Can you please help how to achieve this in Hana Scipt.

   regexp_replace(field1,'^[^|]*\|([^|]*).*$','\1')   as channel_1,

   regexp_replace(field1,'^([^|]*\|){2}([^|]*).*$','\2')  as num_channel_1,

sample data format for field1 as below

123123|444|555|6666|77|88

Thanks,

Kris

Accepted Solutions (0)

Answers (1)

Answers (1)

anindya_bose
Active Contributor
0 Kudos

Hi Kris

I think exact function like regexp_replace is not available in HANA, you might want to use "REPLACE" , "SUBSTRING" and concat them to achieve the same.


Can you please tell me what out is your intended out put for 123123|444|555|6666|77|88 ?



Cheers

Anindya

lbreddemann
Active Contributor
0 Kudos

This is a typical case of misusing this community as a search engine and then coming up with a wrong answer.

REPLACE_REGEXPR - SAP HANA SQL and System Views Reference - SAP Library

anindya_bose
Active Contributor
0 Kudos

sorry my answer was for Expression Editor... I just checked the Expression Editor of Calculation View and did not find this function.

Does this also work for Expression Editor ?

Anindya

lbreddemann
Active Contributor
0 Kudos

As this is an SQL function I wouldn't expect it to work in the classic expression editor.

However with SPS 11 you can choose to use SQL for the language of calculated columns - so there you go.