0

I am trying to visualize field data but based on the first 3 characters within the string. Say the field contains "+44123456", I want the pie chart to visualize based on "+44" only.

Please assist me in achieving this with advanced JSON field ?

1 Answer 1

0

You can do it via using the "Advanced JSON" input field :

Try following script :

{
    "script": "( _value.indexOf(' ') > 0 ? _value.substring(_value.lastIndexOf(' ')) : _value )"
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.