<?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: Stats dc command on the total row? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Stats-dc-command-on-the-total-row/m-p/697612#M57190</link>
    <description>&lt;P&gt;Thank you for this, to get in the same column , I renamed the "as overall_distinct_user_count" in the appendpipe command.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eventstats dc(user_numbers) as overall_distinct_user_count
| stats dc(user_numbers) as distinct_users_for_device, first(overall_distinct_user_count) as overall_distinct_user_count by device
| appendpipe [stats max(overall_distinct_user_count) as distinct_users_for_device | eval device = "All Devices" ]
| table device, distinct_users_for_device&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 28 Aug 2024 14:47:13 GMT</pubDate>
    <dc:creator>sumarri</dc:creator>
    <dc:date>2024-08-28T14:47:13Z</dc:date>
    <item>
      <title>Stats dc command on the total row?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Stats-dc-command-on-the-total-row/m-p/697369#M57161</link>
      <description>&lt;P&gt;So, I want the the distinct count of user_numbers by device, but in the same chat/table, I want the distinct count of all the user_numbers in the last column&amp;nbsp; called total is this possible to get a stats formula with different fields in the by?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;This is some thing that I have:&lt;BR /&gt;&lt;BR /&gt;| stats dc(user_numbers) by device&lt;/P&gt;&lt;P&gt;but I also want to show in the same table as the total:&lt;BR /&gt;| stats dc(user_numbers)&lt;/P&gt;&lt;P&gt;right now I count duplicates and show this:&amp;nbsp;&lt;/P&gt;&lt;P&gt;| addcoltotals label="Total Members" labelfield=device&lt;/P&gt;&lt;P&gt;I really hope this is possible! Thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 26 Aug 2024 20:56:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Stats-dc-command-on-the-total-row/m-p/697369#M57161</guid>
      <dc:creator>sumarri</dc:creator>
      <dc:date>2024-08-26T20:56:05Z</dc:date>
    </item>
    <item>
      <title>Re: Stats dc command on the total row?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Stats-dc-command-on-the-total-row/m-p/697370#M57162</link>
      <description>&lt;P&gt;You could do something like this using &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Eventstats" target="_self"&gt;eventstats&lt;/A&gt;:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults format=json data="[{\"device\":\"foo\", \"user_numbers\":19}, {\"device\":\"foo\", \"user_numbers\":39}, {\"device\":\"bar\", \"user_numbers\":39}, {\"device\":\"foo\", \"user_numbers\":44}]"

| eventstats dc(user_numbers) as overall_distinct_user_count
| stats dc(user_numbers), first(overall_distinct_user_count) as overall_distinct_user_count by device&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Aug 2024 21:10:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Stats-dc-command-on-the-total-row/m-p/697370#M57162</guid>
      <dc:creator>_JP</dc:creator>
      <dc:date>2024-08-26T21:10:45Z</dc:date>
    </item>
    <item>
      <title>Re: Stats dc command on the total row?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Stats-dc-command-on-the-total-row/m-p/697371#M57163</link>
      <description>&lt;P&gt;Is is possible to get it to the last row???&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Aug 2024 21:13:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Stats-dc-command-on-the-total-row/m-p/697371#M57163</guid>
      <dc:creator>sumarri</dc:creator>
      <dc:date>2024-08-26T21:13:37Z</dc:date>
    </item>
    <item>
      <title>Re: Stats dc command on the total row?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Stats-dc-command-on-the-total-row/m-p/697372#M57164</link>
      <description>&lt;P&gt;You can use &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Appendpipe" target="_self"&gt;appendpipe&lt;/A&gt; to add a row using the current search pipeline context:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults format=json data="[{\"device\":\"foo\", \"user_numbers\":19}, {\"device\":\"foo\", \"user_numbers\":39}, {\"device\":\"bar\", \"user_numbers\":39}, {\"device\":\"foo\", \"user_numbers\":44}]"

| eventstats dc(user_numbers) as overall_distinct_user_count
| stats dc(user_numbers) as distinct_users_for_device, first(overall_distinct_user_count) as overall_distinct_user_count by device
| appendpipe [stats max(overall_distinct_user_count) as overall_distinct_user_count | eval device = "All Devices" ]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Aug 2024 21:44:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Stats-dc-command-on-the-total-row/m-p/697372#M57164</guid>
      <dc:creator>_JP</dc:creator>
      <dc:date>2024-08-26T21:44:48Z</dc:date>
    </item>
    <item>
      <title>Re: Stats dc command on the total row?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Stats-dc-command-on-the-total-row/m-p/697612#M57190</link>
      <description>&lt;P&gt;Thank you for this, to get in the same column , I renamed the "as overall_distinct_user_count" in the appendpipe command.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eventstats dc(user_numbers) as overall_distinct_user_count
| stats dc(user_numbers) as distinct_users_for_device, first(overall_distinct_user_count) as overall_distinct_user_count by device
| appendpipe [stats max(overall_distinct_user_count) as distinct_users_for_device | eval device = "All Devices" ]
| table device, distinct_users_for_device&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2024 14:47:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Stats-dc-command-on-the-total-row/m-p/697612#M57190</guid>
      <dc:creator>sumarri</dc:creator>
      <dc:date>2024-08-28T14:47:13Z</dc:date>
    </item>
  </channel>
</rss>

