Extract substring using Java Script

Hey everyone

I have a solid T-SQL background. Usually, when I want to extract a text out of a sentence, I use substring and Charindex

Example: Start “Extract this text” End

I would write : SUbstring (text, Charindex(“start”, text) + 6, Charindex (“end” , text)

What’s a possible way to do so in javascript to create a custom field?

Regards

Hi @mmawla ,
If you have imported some issue property then you can create a formula with a regular expression and ExtractString():

CASE WHEN
NOT IsEmpty([Measures].[Issue Multi line text])
THEN
ExtractString(
  [Measures].[Issue Multi line text],
  '(Start “)(.*)(” End)',
    2
)
END

In the report:

best,
Gerda // support@eazyBI.com

1 Like