Using scripted field again

Hi, I have a scripted field returning a number "x" based on some calculation using Painless language, now I want to use that same number "x" in a new scripted field running expression language:
(doc['something'].value / doc['x'].value) *100

But it's throwing an exception:
"type":"parse_exception","reason":"Field [x] does not exist in mappings"}}

Now the exception is obvious as the field "x" is a scripted field and not a doc field so is there any solution to reuse my "x" variable somehow using expression lang?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.