Date Visitors
Jul/14/2017 26
Jun/3/2017 34
Sep/30/2016 2
Jul/29/2017 71
Sep/9/2016 10
Jun/22/2017 40
Apr/21/2017 1
Jul/4/2017 57
Sep/24/2016 1
@shankeranollamurali, you can use stats command for finding sum of visitors per year. Try the following:
| inputlookup testData.csv
| eval Year=case(match(Date,"2016$"),2016,match(Date,"2017$"),2017)
| stats sum(Visitors) as Visitors by Year
Following is the run anywhere dashboard based on sample data provided in the question:
| makeresults
| eval data="Jul/14/2017,26;Jun/3/2017,34;Sep/30/2016,2;Jul/29/2017,71;Sep/9/2016,10;Jun/22/2017,40;Apr/21/2017,1;Jul/4/2017,57;Sep/24/2016,1"
| makemv data delim=";"
| mvexpand data
| eval data=split(data,",")
| eval Date=mvindex(data,0),Visitors=mvindex(data,1)
| table Date Visitors
| eval Year=case(match(Date,"2016$"),2016,match(Date,"2017$"),2017)
| stats sum(Visitors) as Visitors by Year
Go to Settings>>Lookups » Lookup table files » Add new
here upload csv file and give Destination filename as lookupname.csv
then to create dashboard
Go to Settings>>User interface » Views
click on New and write your xml query and provide Destination app name
@shankeranollamurali, you can use stats command for finding sum of visitors per year. Try the following:
| inputlookup testData.csv
| eval Year=case(match(Date,"2016$"),2016,match(Date,"2017$"),2017)
| stats sum(Visitors) as Visitors by Year
Following is the run anywhere dashboard based on sample data provided in the question:
| makeresults
| eval data="Jul/14/2017,26;Jun/3/2017,34;Sep/30/2016,2;Jul/29/2017,71;Sep/9/2016,10;Jun/22/2017,40;Apr/21/2017,1;Jul/4/2017,57;Sep/24/2016,1"
| makemv data delim=";"
| mvexpand data
| eval data=split(data,",")
| eval Date=mvindex(data,0),Visitors=mvindex(data,1)
| table Date Visitors
| eval Year=case(match(Date,"2016$"),2016,match(Date,"2017$"),2017)
| stats sum(Visitors) as Visitors by Year