<?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: Create a Pivot Table in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Create-a-Pivot-Table/m-p/45435#M2227</link>
    <description>&lt;P&gt;This is a fairly simple search, provided that you extract the fields City and Response from a set of events, where each event is one line of your data:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | chart count by City Response
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 08 Sep 2010 04:43:25 GMT</pubDate>
    <dc:creator>Stephen_Sorkin</dc:creator>
    <dc:date>2010-09-08T04:43:25Z</dc:date>
    <item>
      <title>Create a Pivot Table</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Create-a-Pivot-Table/m-p/45434#M2226</link>
      <description>&lt;P&gt;Hi, I have a few columns of data and I would like to generate a pivot table that is similar to the one in Excel.&lt;/P&gt;

&lt;P&gt;As an example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Date/City/Day/Response
-----------------
09-01/New York/Monday/Yes
09-05/New York/Friday/Yes
09-01/Los Angeles/Tuesday/Yes
09-07/Chicago/Monday/No
08-28/San Francisco/Wednesday/No
08-23/Dallas/Sunday/Yes
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;How can I organize/sort these data so it reports the following for all days:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;         City/Yes/No
      Chicago/0  /1
       Dallas/1  /0
  Los Angeles/1  /0
     New York/2  /0
San Francisco/0  /1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And reports the following for Monday only:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    City/Yes/No
 Chicago/0  /1
New York/1  /0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 08 Sep 2010 02:09:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Create-a-Pivot-Table/m-p/45434#M2226</guid>
      <dc:creator>wyang6</dc:creator>
      <dc:date>2010-09-08T02:09:33Z</dc:date>
    </item>
    <item>
      <title>Re: Create a Pivot Table</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Create-a-Pivot-Table/m-p/45435#M2227</link>
      <description>&lt;P&gt;This is a fairly simple search, provided that you extract the fields City and Response from a set of events, where each event is one line of your data:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | chart count by City Response
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 08 Sep 2010 04:43:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Create-a-Pivot-Table/m-p/45435#M2227</guid>
      <dc:creator>Stephen_Sorkin</dc:creator>
      <dc:date>2010-09-08T04:43:25Z</dc:date>
    </item>
    <item>
      <title>Re: Create a Pivot Table</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Create-a-Pivot-Table/m-p/45436#M2228</link>
      <description>&lt;P&gt;The default lists the fields in alphabetical order. What's the syntax if I want to list them in a non-alphabetical order? i.e.,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;     City/Yes/No
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;San Francisco/0  /1&lt;BR /&gt;
      Chicago/0  /1&lt;BR /&gt;
       Dallas/1  /0&lt;BR /&gt;
  Los Angeles/1  /0&lt;BR /&gt;
     New York/2  /0&lt;/P&gt;

&lt;P&gt;Thanks again!&lt;/P&gt;</description>
      <pubDate>Sat, 09 Oct 2010 03:30:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Create-a-Pivot-Table/m-p/45436#M2228</guid>
      <dc:creator>wyang6</dc:creator>
      <dc:date>2010-10-09T03:30:29Z</dc:date>
    </item>
    <item>
      <title>Re: Create a Pivot Table</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Create-a-Pivot-Table/m-p/45437#M2229</link>
      <description>&lt;P&gt;Yes, with difficulty. Create an auxiliary field with the eval command and a case statement like: ... | eval order = case(City == "SF", 1, ...) | sort order | fields - order&lt;/P&gt;</description>
      <pubDate>Sat, 09 Oct 2010 11:53:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Create-a-Pivot-Table/m-p/45437#M2229</guid>
      <dc:creator>Stephen_Sorkin</dc:creator>
      <dc:date>2010-10-09T11:53:05Z</dc:date>
    </item>
    <item>
      <title>Re: Create a Pivot Table</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Create-a-Pivot-Table/m-p/45438#M2230</link>
      <description>&lt;P&gt;Thanks again Stephen for your help. There is one draw back from your solution. I want to sort for a specific range of dates and the data often does not contain "San Francisco". The code given above will create a "San Francisco" field even though no applicable data is available.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Oct 2010 21:58:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Create-a-Pivot-Table/m-p/45438#M2230</guid>
      <dc:creator>wyang6</dc:creator>
      <dc:date>2010-10-27T21:58:24Z</dc:date>
    </item>
    <item>
      <title>Re: Create a Pivot Table</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Create-a-Pivot-Table/m-p/45439#M2231</link>
      <description>&lt;P&gt;If you have a CSV file that enumerates all cities, than before the "| chart" you can add "| inputlookup append=t &lt;FOO&gt;.csv" where &lt;FOO&gt;.csv is in etc/apps/&lt;APPNAME&gt;/lookups.&lt;/APPNAME&gt;&lt;/FOO&gt;&lt;/FOO&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Oct 2010 01:26:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Create-a-Pivot-Table/m-p/45439#M2231</guid>
      <dc:creator>Stephen_Sorkin</dc:creator>
      <dc:date>2010-10-28T01:26:27Z</dc:date>
    </item>
  </channel>
</rss>

