Hello Niketnilay,
I have some data like below
date, code, price
20171108,A,1
20171109,A,1.5
20171110,A,2
20171108,B,10
20171109,B,20
20171110,B,5
want to get result like below
date, codeA, codeB
20171108,,0,0
20171109,,50,200
20171110,,200,-50
my idea is
index=test code IN (1,3)
| foreach 1 3
[ eval code<<101010)> > = [search index=test code=<<101010)> > | tail 1 | eval c= price|return $c ]]
| foreach code_* [eval p_code_<>=close/close_<>]
| ... chart sum(p_code) by date, code
I need the subsearch to search the oldest record and return the price as the base.
101010=FIELD
Thank your for your help
... View more