Scripted field using 2 others scripted fields


Here's what I want to have in a DataTable visualization :

I'm using 2 scripted fields :

  • 1 to get the value of column Date1
  • 1 to get the value of column Date2

For my third column, I would like to use the values that I get in both columns and do another script to calculate the values (it's the working days between the 2 dates)

Can I do it with the scripted fields ? Because in painless language I only saw "doc["my_field"].value" but never "doc["my_scripted_field"].value

Is there a way to do it or am I doing it wrong ?

You can't reference scripted fields from other scripted fields like that in Painless unfortunately.

Okay that's what I thought...

So I guess i'll have to find a workaround solution for this problem. Thanks.

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