<?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: Is there an alternative to the Appendcol command? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Is-there-an-alternative-to-the-Appendcol-command/m-p/403246#M116686</link>
    <description>&lt;P&gt;hi @VI371887 &lt;/P&gt;

&lt;P&gt;try like this with your second approach&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=int  source="HK" FUNCTION=* | stats sum(PERCENT90) as HK by FUNCTION |
 append  [search index=int  source="SG" FUNCTION=* | stats sum(PERCENT90) as SG by FUNCTION] |stats values(*) as *  by FUNCTION
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 26 Nov 2018 08:06:03 GMT</pubDate>
    <dc:creator>harishalipaka</dc:creator>
    <dc:date>2018-11-26T08:06:03Z</dc:date>
    <item>
      <title>Is there an alternative to the Appendcol command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-an-alternative-to-the-Appendcol-command/m-p/403245#M116685</link>
      <description>&lt;P&gt;Need help!!!&lt;/P&gt;

&lt;P&gt;I am intending to make a table with the country wise sum(percent90). If i do the below, it will just sum percent90 per FUNCTION &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=int  source="*" FUNCTION=* | stats sum(PERCENT90)  by FUNCTION
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So I tried using append which... &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=int  source="HK" FUNCTION=* | stats sum(PERCENT90) as HK by FUNCTION |
append  [search index=int  source="SG" FUNCTION=* | stats sum(PERCENT90) as SG by FUNCTION]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;...would give the below output&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;FUNCTION           |  HK        |              SG
AGE             |107.773        |
CLT                |49.206      |
COM             | 7.497     |
RIO             |56.803     |
AGE            |               |            120.644
CLT                 |         |             37.6
COM                 |          |              61.778
CONSULT     |                  |             10.115
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What I am looking for is as shown below, no repetition of Function name below.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;FUNCTION           |  HK        |              SG
AGE                |107.773     |         120.644
CLT                    |49.206      |         37.6
COM                | 7.497      |         61.778
RIO                |56.803      |            0
 CONSULT            |        0        |             10.115
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So i tried the appendcol command, but it messes up the data, like in the above example, if Function Consult and RIO don't have a value for any country, it would show "0 " instead Appendcol with below query does..&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=int  source="HK" FUNCTION=* | stats sum(PERCENT90) as HK by FUNCTION |
    appendcols  [search index=int  source="SG" FUNCTION=* | stats sum(PERCENT90) as SG by FUNCTION] 

FUNCTION           |  HK        |              SG
AGE                |107.773     |         120.644
CLT                    |49.206      |         37.6
COM                | 7.497      |         61.778
RIO                |56.803      |          10.115
 CONSULT            |              |         
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It fills the details from Consult in RIO for SG which is wrong. &lt;/P&gt;

&lt;P&gt;What can be done here?&lt;/P&gt;</description>
      <pubDate>Mon, 26 Nov 2018 07:56:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-an-alternative-to-the-Appendcol-command/m-p/403245#M116685</guid>
      <dc:creator>VI371887</dc:creator>
      <dc:date>2018-11-26T07:56:09Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an alternative to the Appendcol command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-an-alternative-to-the-Appendcol-command/m-p/403246#M116686</link>
      <description>&lt;P&gt;hi @VI371887 &lt;/P&gt;

&lt;P&gt;try like this with your second approach&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=int  source="HK" FUNCTION=* | stats sum(PERCENT90) as HK by FUNCTION |
 append  [search index=int  source="SG" FUNCTION=* | stats sum(PERCENT90) as SG by FUNCTION] |stats values(*) as *  by FUNCTION
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 26 Nov 2018 08:06:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-an-alternative-to-the-Appendcol-command/m-p/403246#M116686</guid>
      <dc:creator>harishalipaka</dc:creator>
      <dc:date>2018-11-26T08:06:03Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an alternative to the Appendcol command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-an-alternative-to-the-Appendcol-command/m-p/403247#M116687</link>
      <description>&lt;P&gt;Thanks!! It worked but can you help me understand what it is doing ?&lt;/P&gt;</description>
      <pubDate>Mon, 26 Nov 2018 08:56:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-an-alternative-to-the-Appendcol-command/m-p/403247#M116687</guid>
      <dc:creator>VI371887</dc:creator>
      <dc:date>2018-11-26T08:56:49Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an alternative to the Appendcol command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-an-alternative-to-the-Appendcol-command/m-p/403248#M116688</link>
      <description>&lt;P&gt;I'd actually avoid append here. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=int  source="HK" OR source="SG" FUNCTION=* | chart sum(PERCENT90) over FUNCTION by source
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;should be faster...&lt;/P&gt;</description>
      <pubDate>Mon, 26 Nov 2018 09:46:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-an-alternative-to-the-Appendcol-command/m-p/403248#M116688</guid>
      <dc:creator>knielsen</dc:creator>
      <dc:date>2018-11-26T09:46:06Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an alternative to the Appendcol command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-an-alternative-to-the-Appendcol-command/m-p/403249#M116689</link>
      <description>&lt;P&gt;It will adjust the values based on Function field.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Nov 2018 09:59:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-an-alternative-to-the-Appendcol-command/m-p/403249#M116689</guid>
      <dc:creator>harishalipaka</dc:creator>
      <dc:date>2018-11-26T09:59:05Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an alternative to the Appendcol command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-an-alternative-to-the-Appendcol-command/m-p/403250#M116690</link>
      <description>&lt;P&gt;Thanks!! this makes it more minimal and easy to migrate. &lt;/P&gt;</description>
      <pubDate>Thu, 29 Nov 2018 06:40:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-an-alternative-to-the-Appendcol-command/m-p/403250#M116690</guid>
      <dc:creator>VI371887</dc:creator>
      <dc:date>2018-11-29T06:40:18Z</dc:date>
    </item>
  </channel>
</rss>

