<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Given the attached Data File (testData.csv), add it as a lookup file and create a dashboard showing a barchart showing the total number of visits received in 2016 vs 2017 in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Given-the-attached-Data-File-testData-csv-add-it-as-a-lookup/m-p/298087#M93285</link>
    <description>&lt;P&gt;@shankeranollamurali, you can use stats command for finding sum of visitors per year. Try the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup testData.csv
| eval Year=case(match(Date,"2016$"),2016,match(Date,"2017$"),2017)
| stats sum(Visitors) as Visitors by Year
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Following is the run anywhere dashboard based on sample data provided in the question:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| 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
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 19 Feb 2018 07:30:39 GMT</pubDate>
    <dc:creator>niketn</dc:creator>
    <dc:date>2018-02-19T07:30:39Z</dc:date>
    <item>
      <title>Given the attached Data File (testData.csv), add it as a lookup file and create a dashboard showing a barchart showing the total number of visits received in 2016 vs 2017</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Given-the-attached-Data-File-testData-csv-add-it-as-a-lookup/m-p/298086#M93284</link>
      <description>&lt;P&gt;Date    Visitors&lt;BR /&gt;
Jul/14/2017 26&lt;BR /&gt;
Jun/3/2017  34&lt;BR /&gt;
Sep/30/2016 2&lt;BR /&gt;
Jul/29/2017 71&lt;BR /&gt;
Sep/9/2016  10&lt;BR /&gt;
Jun/22/2017 40&lt;BR /&gt;
Apr/21/2017 1&lt;BR /&gt;
Jul/4/2017  57&lt;BR /&gt;
Sep/24/2016 1&lt;/P&gt;</description>
      <pubDate>Mon, 19 Feb 2018 06:36:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Given-the-attached-Data-File-testData-csv-add-it-as-a-lookup/m-p/298086#M93284</guid>
      <dc:creator>shankeranollamu</dc:creator>
      <dc:date>2018-02-19T06:36:40Z</dc:date>
    </item>
    <item>
      <title>Re: Given the attached Data File (testData.csv), add it as a lookup file and create a dashboard showing a barchart showing the total number of visits received in 2016 vs 2017</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Given-the-attached-Data-File-testData-csv-add-it-as-a-lookup/m-p/298087#M93285</link>
      <description>&lt;P&gt;@shankeranollamurali, you can use stats command for finding sum of visitors per year. Try the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup testData.csv
| eval Year=case(match(Date,"2016$"),2016,match(Date,"2017$"),2017)
| stats sum(Visitors) as Visitors by Year
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Following is the run anywhere dashboard based on sample data provided in the question:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| 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
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 19 Feb 2018 07:30:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Given-the-attached-Data-File-testData-csv-add-it-as-a-lookup/m-p/298087#M93285</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-02-19T07:30:39Z</dc:date>
    </item>
    <item>
      <title>Re: Given the attached Data File (testData.csv), add it as a lookup file and create a dashboard showing a barchart showing the total number of visits received in 2016 vs 2017</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Given-the-attached-Data-File-testData-csv-add-it-as-a-lookup/m-p/298088#M93286</link>
      <description>&lt;P&gt;Go to &lt;CODE&gt;Settings&amp;gt;&amp;gt;Lookups » Lookup table files » Add new&lt;/CODE&gt;&lt;BR /&gt;
here upload csv file and give Destination filename  as lookupname.csv&lt;BR /&gt;
then to create dashboard &lt;BR /&gt;
Go to &lt;CODE&gt;Settings&amp;gt;&amp;gt;User interface » Views&lt;/CODE&gt; click on New and write your xml query and provide Destination app name&lt;/P&gt;</description>
      <pubDate>Mon, 19 Feb 2018 07:31:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Given-the-attached-Data-File-testData-csv-add-it-as-a-lookup/m-p/298088#M93286</guid>
      <dc:creator>493669</dc:creator>
      <dc:date>2018-02-19T07:31:10Z</dc:date>
    </item>
  </channel>
</rss>

