Hi everyone,
I saw this post and tried.
To get max of fieldA and fieldB,
I tried Formula:
clamp(max(fieldA), max(fieldB), 10000)
,
but it does not worked and the cell remains empty.
in my case, max(fieldA)=3
and max(fieldB)=5
, then clamp(max(fieldA), max(fieldB), 100000)
must be 5, isn't it? Is something wrong?
clamp(3,5,10000)
returns 5
.
I tried this formula because the formula doesn't work fine if the difference is less than 1.
When max(fieldA)=4.8 and max(fieldB)=5 for example,
clamp(max(fieldA)-max(fieldB),0,1)*max(fieldA) + clamp(max(fieldB)-max(fieldA),0,1)*max(fieldB)
returns 0 + (5-4.8)*5 = 1
. It must be 5
.
How to reproduce:
case1:
PUT /test_lens_formula/
POST /test_lens_formula/_bulk
{"index":{}}
{"fieldA":3, "fieldB":5}
{"index":{}}
{"fieldA":1, "fieldB":2}
case2:
PUT /test_lens_formula2/
POST /test_lens_formula2/_bulk
{"index":{}}
{"fieldA":4.8, "fieldB":5}
{"index":{}}
{"fieldA":1, "fieldB":2}