<?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: combine multiple values of a table column based on other column value in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/combine-multiple-values-of-a-table-column-based-on-other-column/m-p/383159#M40967</link>
    <description>&lt;P&gt;Also, I am getting duplicate rows now &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; &lt;/P&gt;</description>
    <pubDate>Mon, 17 Sep 2018 07:26:20 GMT</pubDate>
    <dc:creator>architkhanna</dc:creator>
    <dc:date>2018-09-17T07:26:20Z</dc:date>
    <item>
      <title>combine multiple values of a table column based on other column value</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/combine-multiple-values-of-a-table-column-based-on-other-column/m-p/383155#M40963</link>
      <description>&lt;P&gt;I have table in my panel that has columns including owner,country,position,wbs.&lt;BR /&gt;
Right now, seperate rows are made if one owner has multiple wbs.&lt;BR /&gt;
I wanted to make a single row for a owner that has multiple wbs values and shown in a comma seprated wbs values.&lt;/P&gt;

&lt;P&gt;Right now i have&lt;/P&gt;

&lt;P&gt;owner   wbs&lt;BR /&gt;
abc     100&lt;BR /&gt;
xyz     101&lt;BR /&gt;
abc     102&lt;BR /&gt;
abc     103&lt;/P&gt;

&lt;P&gt;it should show&lt;/P&gt;

&lt;P&gt;owner   wbs&lt;BR /&gt;
abc     100,102,103&lt;BR /&gt;
xyz     101&lt;/P&gt;</description>
      <pubDate>Mon, 17 Sep 2018 06:33:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/combine-multiple-values-of-a-table-column-based-on-other-column/m-p/383155#M40963</guid>
      <dc:creator>architkhanna</dc:creator>
      <dc:date>2018-09-17T06:33:15Z</dc:date>
    </item>
    <item>
      <title>Re: combine multiple values of a table column based on other column value</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/combine-multiple-values-of-a-table-column-based-on-other-column/m-p/383156#M40964</link>
      <description>&lt;P&gt;@architkhanna,&lt;/P&gt;

&lt;P&gt;Can you please try this?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;YOUR_SEARCH | stats delim="," values(wbs) as wbc by owner | nomv wbc
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Sample Search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults | eval owner="abc",wbs="100" | append [| makeresults | eval owner="xyz",wbs="101"] | append [| makeresults | eval owner="abc",wbs="102"] | append [| makeresults | eval owner="abc",wbs="103"] | stats delim="," values(wbs) as wbc by owner | nomv wbc
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;[Edited Search]&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults | eval owner="abc",wbs="100" | append [| makeresults | eval owner="xyz",wbs="101"] | append [| makeresults | eval owner="abc",wbs="102"] | append [| makeresults | eval owner="abc",wbs="103"] | stats delim="," values(wbs) as wbc latest(_time) as Time by owner | nomv wbc | sort Time | fields - Time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can &lt;CODE&gt;| sort Time&lt;/CODE&gt; as per your requirement.&lt;/P&gt;

&lt;P&gt;Added payrate column&lt;/P&gt;

&lt;P&gt;Try:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;YOUR_SEARCH | stats delim="," values(wbs) as wbc latest(_time) as Time values(payrate) as payrate by owner | nomv wbc |nomv payrate | sort - Time | fields - Time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Sample:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults | eval owner="abc",wbs="100",payrate="72" | append [| makeresults | eval owner="xyz",wbs="101",payrate="21"] | append [| makeresults | eval owner="abc",wbs="102",payrate="65"] | append [| makeresults | eval owner="abc",wbs="103",payrate="82"] | stats delim="," values(wbs) as wbc latest(_time) as Time values(payrate) as payrate by owner | nomv wbc |nomv payrate | sort - Time | fields - Time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 17 Sep 2018 06:56:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/combine-multiple-values-of-a-table-column-based-on-other-column/m-p/383156#M40964</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2018-09-17T06:56:02Z</dc:date>
    </item>
    <item>
      <title>Re: combine multiple values of a table column based on other column value</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/combine-multiple-values-of-a-table-column-based-on-other-column/m-p/383157#M40965</link>
      <description>&lt;P&gt;Thank you so so much.this works.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Sep 2018 07:08:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/combine-multiple-values-of-a-table-column-based-on-other-column/m-p/383157#M40965</guid>
      <dc:creator>architkhanna</dc:creator>
      <dc:date>2018-09-17T07:08:51Z</dc:date>
    </item>
    <item>
      <title>Re: combine multiple values of a table column based on other column value</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/combine-multiple-values-of-a-table-column-based-on-other-column/m-p/383158#M40966</link>
      <description>&lt;P&gt;Just a thought.&lt;BR /&gt;
This messes up the order of columns. This new column have moved to almost end of the table for which I need to scroll (there are many fields and earlier it used to come in 4th place)&lt;BR /&gt;
Does Splunk decide the order randomly.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Sep 2018 07:14:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/combine-multiple-values-of-a-table-column-based-on-other-column/m-p/383158#M40966</guid>
      <dc:creator>architkhanna</dc:creator>
      <dc:date>2018-09-17T07:14:22Z</dc:date>
    </item>
    <item>
      <title>Re: combine multiple values of a table column based on other column value</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/combine-multiple-values-of-a-table-column-based-on-other-column/m-p/383159#M40967</link>
      <description>&lt;P&gt;Also, I am getting duplicate rows now &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; &lt;/P&gt;</description>
      <pubDate>Mon, 17 Sep 2018 07:26:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/combine-multiple-values-of-a-table-column-based-on-other-column/m-p/383159#M40967</guid>
      <dc:creator>architkhanna</dc:creator>
      <dc:date>2018-09-17T07:26:20Z</dc:date>
    </item>
    <item>
      <title>Re: combine multiple values of a table column based on other column value</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/combine-multiple-values-of-a-table-column-based-on-other-column/m-p/383160#M40968</link>
      <description>&lt;P&gt;Added new search in Answer. Please check and revert. Accept and upvote this answer if it helps you.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Sep 2018 07:37:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/combine-multiple-values-of-a-table-column-based-on-other-column/m-p/383160#M40968</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2018-09-17T07:37:47Z</dc:date>
    </item>
    <item>
      <title>Re: combine multiple values of a table column based on other column value</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/combine-multiple-values-of-a-table-column-based-on-other-column/m-p/383161#M40969</link>
      <description>&lt;P&gt;SO we are almost near.the table has many rows out of which I showed two collumns in example. Now using the following code&lt;BR /&gt;
YOUR_SEARCH | stats delim="," values(wbs) as wbc by owner | nomv wbc&lt;/P&gt;

&lt;P&gt;I am getting one row with wbs values comma seperated but like 101,102,101. Same value is repeated.this is due to the fact that I have two rows having same owner and same wbs but different other values.&lt;/P&gt;

&lt;P&gt;owner   wbs   payrate&lt;BR /&gt;
abc     100         72&lt;BR /&gt;
xyz     101          21&lt;BR /&gt;
abc     102         65&lt;BR /&gt;
abc     100         82&lt;/P&gt;

&lt;P&gt;it is showing&lt;/P&gt;

&lt;P&gt;owner   wbs               payrate&lt;BR /&gt;
abc     100,102,100    72&lt;BR /&gt;
xyz     101                    21&lt;/P&gt;</description>
      <pubDate>Mon, 17 Sep 2018 08:06:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/combine-multiple-values-of-a-table-column-based-on-other-column/m-p/383161#M40969</guid>
      <dc:creator>architkhanna</dc:creator>
      <dc:date>2018-09-17T08:06:37Z</dc:date>
    </item>
    <item>
      <title>Re: combine multiple values of a table column based on other column value</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/combine-multiple-values-of-a-table-column-based-on-other-column/m-p/383162#M40970</link>
      <description>&lt;P&gt;Please check updated answer.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Sep 2018 09:38:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/combine-multiple-values-of-a-table-column-based-on-other-column/m-p/383162#M40970</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2018-09-17T09:38:29Z</dc:date>
    </item>
    <item>
      <title>Re: combine multiple values of a table column based on other column value</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/combine-multiple-values-of-a-table-column-based-on-other-column/m-p/383163#M40971</link>
      <description>&lt;P&gt;@architkhanna,&lt;/P&gt;

&lt;P&gt;Did you get chance to check my updated answer?&lt;/P&gt;</description>
      <pubDate>Wed, 19 Sep 2018 09:24:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/combine-multiple-values-of-a-table-column-based-on-other-column/m-p/383163#M40971</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2018-09-19T09:24:51Z</dc:date>
    </item>
  </channel>
</rss>

