Thanks a ton ITWhisperer. This is 95% close to what I am looking. My only struggle is to avoid the week where there is no data..... I modified the string a little bit. But, I am always getting ActiveWeeks as 5 for a 30day span. If I dont have data for week1...I want to avoid that from 5 weeks duration ActivitySum includes ActiveWeeks also. So, I substracted the weeknumber from ActivitySum . I would like to see Activeweeks as 4 (removing that week from the weeks count from 30days span. ) not sure how to substract the null data weeks.... 😞 index=myindex source=mysource earliest=-30d@d | bin _time span=1w | eval weeknumber=strftime(_time,"Week%U") | eval time=strftime(_time, "%Y-%m-%d %l:%M:%S %p") | chart sum(sum) as Traffic by repoName, weeknumber | eval ActiveWeeks=0 | foreach Week* [| eval ActiveWeeks=if(isnotnull('weeknumber'),ActiveWeeks,ActiveWeeks + 1)] | addtotals fieldname=ActivitySum | eval ActivitySum = ActivitySum-ActiveWeeks | eval Activity=round(ActivitySum/ActiveWeeks,0)
... View more