<?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: Problem with the summation in chart command in SPLUNK in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Problem-with-the-summation-in-chart-command-in-SPLUNK/m-p/54029#M13186</link>
    <description>&lt;P&gt;I have given this code , but it gives me some different answer, I want to compare the number of exit with the number or entry for a particular Card_num for a particular day&lt;/P&gt;

&lt;P&gt;|inputlookup "Data-Sample.csv" | table "TRANSIT_DATE","NAME","SURNAME","IDENTIFIER","CARD_NUMBER","STR_DIRECTION","STR_TRANSIT_STATUS","TERMINAL" | chart limit=29 count(eval(STR_DIRECTION="Entry" OR STR_DIRECTION="Exit")) as "Total_Count" over "TRANSIT_DATE" by "CARD_NUMBER" |eval a=strptime(TRANSIT_DATE,"%d/%m/%Y") | sort a | fields - a&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 13:27:51 GMT</pubDate>
    <dc:creator>abhayneilam</dc:creator>
    <dc:date>2020-09-28T13:27:51Z</dc:date>
    <item>
      <title>Problem with the summation in chart command in SPLUNK</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Problem-with-the-summation-in-chart-command-in-SPLUNK/m-p/54024#M13181</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I want to find out how what is the total number of "Exit" and "Entry" for the particular CARD_NUMBER for a particular TRANSIT_DATE, for that to do I gave the below query, but it is not returning my any answer,&lt;/P&gt;

&lt;P&gt;Please let me know where I am doing wrong with the query or any other alternative is there :&lt;/P&gt;

&lt;P&gt;chart count((eval(STR_DIRECTION="Entry"))+(eval(STR_DIRECTION="Exit"))) as "Total_Count" over "TRANSIT_DATE" by "CARD_NUMBER"&lt;/P&gt;

&lt;P&gt;Thanks in Advance!!&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 13:27:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Problem-with-the-summation-in-chart-command-in-SPLUNK/m-p/54024#M13181</guid>
      <dc:creator>abhayneilam</dc:creator>
      <dc:date>2020-09-28T13:27:43Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with the summation in chart command in SPLUNK</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Problem-with-the-summation-in-chart-command-in-SPLUNK/m-p/54025#M13182</link>
      <description>&lt;P&gt;This :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;((eval(STR_DIRECTION="Entry"))+(eval(STR_DIRECTION="Exit"))
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;assuming that only 1 statement can be true, will never return anything.&lt;/P&gt;

&lt;P&gt;It evaluates to NULL + 1 or 1 + NULL, which is always null&lt;/P&gt;

&lt;P&gt;i.e.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;* | head 1 | eval a=NULL | eval b=1 | eval c=a+b | table a b c
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So you need an if statement to return sane values:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;( (eval(if(STR_DIRECTION=="Entry",1,0))) + (eval(if(STR_DIRECTION=="Exit",1,0))) )
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;There's probably a far easier way to do this if you post some sample data though&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Update&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | stats count(eval(STR_DIRECTION=="Exit")) as Exit count(eval(STR_DIRECTION=="Entry")) as Entry by TRANSIT_DATE CARD_NUMBER
    | eval Complete=if(Exit==Entry,"Complete","Incomplete")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 07 Mar 2013 08:15:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Problem-with-the-summation-in-chart-command-in-SPLUNK/m-p/54025#M13182</guid>
      <dc:creator>jonuwz</dc:creator>
      <dc:date>2013-03-07T08:15:21Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with the summation in chart command in SPLUNK</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Problem-with-the-summation-in-chart-command-in-SPLUNK/m-p/54026#M13183</link>
      <description>&lt;P&gt;How do I compare the number of entry and exit of each Card_Number against each date, if num of entry is not equal to num of entry for a particular day it means , transaction is incomplete&lt;/P&gt;

&lt;P&gt;please help&lt;/P&gt;</description>
      <pubDate>Thu, 07 Mar 2013 08:41:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Problem-with-the-summation-in-chart-command-in-SPLUNK/m-p/54026#M13183</guid>
      <dc:creator>abhayneilam</dc:creator>
      <dc:date>2013-03-07T08:41:18Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with the summation in chart command in SPLUNK</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Problem-with-the-summation-in-chart-command-in-SPLUNK/m-p/54027#M13184</link>
      <description>&lt;P&gt;This has nothing to do with the original question, also, without sample data this comment is gibberish to me.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Mar 2013 09:38:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Problem-with-the-summation-in-chart-command-in-SPLUNK/m-p/54027#M13184</guid>
      <dc:creator>jonuwz</dc:creator>
      <dc:date>2013-03-07T09:38:20Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with the summation in chart command in SPLUNK</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Problem-with-the-summation-in-chart-command-in-SPLUNK/m-p/54028#M13185</link>
      <description>&lt;P&gt;I have a report which contains few columns as "Date", "Card_num","Status"&lt;/P&gt;

&lt;P&gt;I have the "Date" in %d/%m/%Y format&lt;BR /&gt;
"Card_num" is a numeric field ( Unique value )&lt;BR /&gt;
"Status" Contains two values,either "Entry" or "Exit"&lt;/P&gt;

&lt;P&gt;Now, I would like to know for a particular "Card_num" for a particular "Date" , total number of "Exit" is equal to the total number of "Entry" or not, if it is equal I should make an another column as "Result" and value should be "Complete Transaction" and for unequal number It "Result" should contain "Incomplete Transaction"&lt;/P&gt;

&lt;P&gt;Please help !!&lt;/P&gt;</description>
      <pubDate>Thu, 07 Mar 2013 09:57:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Problem-with-the-summation-in-chart-command-in-SPLUNK/m-p/54028#M13185</guid>
      <dc:creator>abhayneilam</dc:creator>
      <dc:date>2013-03-07T09:57:51Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with the summation in chart command in SPLUNK</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Problem-with-the-summation-in-chart-command-in-SPLUNK/m-p/54029#M13186</link>
      <description>&lt;P&gt;I have given this code , but it gives me some different answer, I want to compare the number of exit with the number or entry for a particular Card_num for a particular day&lt;/P&gt;

&lt;P&gt;|inputlookup "Data-Sample.csv" | table "TRANSIT_DATE","NAME","SURNAME","IDENTIFIER","CARD_NUMBER","STR_DIRECTION","STR_TRANSIT_STATUS","TERMINAL" | chart limit=29 count(eval(STR_DIRECTION="Entry" OR STR_DIRECTION="Exit")) as "Total_Count" over "TRANSIT_DATE" by "CARD_NUMBER" |eval a=strptime(TRANSIT_DATE,"%d/%m/%Y") | sort a | fields - a&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 13:27:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Problem-with-the-summation-in-chart-command-in-SPLUNK/m-p/54029#M13186</guid>
      <dc:creator>abhayneilam</dc:creator>
      <dc:date>2020-09-28T13:27:51Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with the summation in chart command in SPLUNK</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Problem-with-the-summation-in-chart-command-in-SPLUNK/m-p/54030#M13187</link>
      <description>&lt;P&gt;updated answer&lt;/P&gt;</description>
      <pubDate>Thu, 07 Mar 2013 11:30:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Problem-with-the-summation-in-chart-command-in-SPLUNK/m-p/54030#M13187</guid>
      <dc:creator>jonuwz</dc:creator>
      <dc:date>2013-03-07T11:30:29Z</dc:date>
    </item>
  </channel>
</rss>

