Can you please help me to get the stats after July 16th 2018 from other column value sum. We had a valid data from starting to July 16th and after that Overall_Total coming as 0 and we need to calculate overall total from other column "Daily_Count".
sample data,
Date,Brand,Daily_count,Overall_Total
01/01/2018,xxx,20,1500
02/01/2018,yyy,10,100
07/16/2018,xxx,10,1510
07/16/2018,yyy,20,120
07/17/2018,xxx,40,0
07/17/2018,yyy,30,0
Can you please help me to get overall total with previous max + after July 16th Daily_Count.
Expected result,
07/17/2018,xxx,40,15500
07/17/2018,yyy,30,150
Try something like this-
<your query>| eval x=if(Date>"07/16/2018", Daily_count,0)| eval Total=x + Overall_Total| stats latest(Date) as Date , sum(Total) as Overall_Total, sum(x) as Daily_count by Brand