You can translate the question and the replies:

Denodo function equivalent to Power BI's Text.BeforeDelimiter function

Hello. Does Denodo have a function that can do what the Text.BeforeDelimiter function of Power BI (https://learn.microsoft.com/en-us/powerquery-m/text-beforedelimiter) can do? Thank you.
user
31-05-2023 09:42:03 -0400
code

1 Answer

Greetings , Hope you are doing well. The combination of [SUBSTRING](https://community.denodo.com/docs/html/browse/latest/en/vdp/vql/functions/text_functions/text_functions#substring-substr) and [INSTR](https://community.denodo.com/docs/html/browse/latest/en/vdp/vql/functions/text_functions/text_functions#instr) functions could be used to acquire similar results to the Text.BeforeDelimiter function. In the following context: ``` SELECT SUBSTRING('aaa,bbb',0, INSTR(SUBSTRING('aaa,bbb', 0), ',')) FROM dual(); ``` The SUBSTRING is used here to retrieve the desired text portion and the INSTR is used to specify the position of the delimiter and use it as the end index. Alternatively, you could obtain similar results using the [SPLIT](https://community.denodo.com/docs/html/browse/latest/en/vdp/vql/functions/text_functions/text_functions#split) function alongside SUBSTRING. As shown below: ``` SELECT split[0].string as s1 from (select split(',','aaa,bbb')); ``` You can find more relevant examples in the following [community answer](https://community.denodo.com/answers/question/details?questionId=9064u000000L8BjAAK&title=How+to+use+3+parameters+in+%27instr%27+function). Hope this helps !
Denodo Team
01-06-2023 09:57:51 -0400
code
You must sign in to add an answer. If you do not have an account, you can register here