Forum Discussion

agrandi's avatar
agrandi
Frequent Visitor
2 years ago
Solved

Extract Text from value

I'm trying to extract a text from a values of column  issues_comments[comment_body]: comment = var _value0 = issues_comments[comment_body] var _value1 = FIND(", ""id"": ", _value0, 1, 0) var _val...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi agrandi ,

    Please try the following methods and check if they can solve your problem:

    1.Create the simple table.

    2.Create the new measure to extract value.

     

    comment = 
    VAR _value0 = SELECTEDVALUE(issues_comments[comment_body])
    VAR _value1 = FIND(", ""id"": ", _value0, 1, 0)
    VAR _substring = MID(_value0, LEN(_value1) + 61, 13)
    //VAR _substring = RIGHT(_value0, LEN(_value0) - (_value1 + 60))
    RETURN IF(ISBLANK(_substring), 0, _substring)

     

     

    3.Drag the measure into the table visual.

     

    4.Select the column value. The result is shown below.

    Best Regards,

    Wisdom Wu

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.