<?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 How to remove decimal value  from values in a table? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-remove-decimal-value-from-values-in-a-table/m-p/641963#M222380</link>
    <description>&lt;P&gt;Hello everyone,&lt;/P&gt;
&lt;P&gt;I need your help for something, please.&lt;/P&gt;
&lt;P&gt;I need to remove the decimal value for this fields:&lt;/P&gt;
&lt;P&gt;- &lt;STRONG&gt;total&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;- &lt;STRONG&gt;hier&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="anissabnk_1-1683011071227.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/25176iFAA77DB5815653D7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="anissabnk_1-1683011071227.png" alt="anissabnk_1-1683011071227.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;My spl request is :&lt;/P&gt;
&lt;P&gt;| union [ search index="pasrau_statuts_count" libelle IN ("Envoi SNGI OK", "Envoi SNGI KO", "RECU")&lt;BR /&gt;| lookup lk_etapes_pasrau_2020_rj libelle output evenement, ordre ]&lt;BR /&gt;| join type=outer libelle [ search index=pasrau_statuts_count earliest=-100d@d latest=@d libelle IN ("Envoi SNGI OK", "Envoi SNGI KO", "RECU") | eval hier=count | table libelle hier ]&lt;BR /&gt;| eval delta=case(hier &amp;lt; count, "+".(count-hier), hier &amp;gt; count, "-".(hier-count), hier=count, "0")&lt;BR /&gt;| eval libelle=ordre+libelle, total=ordre+"."+count, hier=ordre+"."+hier&lt;BR /&gt;| dedup libelle sortby lookup |stats list(libelle) as libelle , list(total) as total list(hier) as hier list(delta) as "DeltaJ/J-1" by evenement&lt;BR /&gt;| sort libelle&lt;BR /&gt;|rex field=libelle mode=sed "s/^[0-9]+//g"&lt;BR /&gt;|rex field=total mode=sed "s/^[0-9]\.+//g"&lt;BR /&gt;|rex field=hier mode=sed "s/^[0-9]\.+//g"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you so much&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 02 May 2023 13:47:35 GMT</pubDate>
    <dc:creator>anissabnk</dc:creator>
    <dc:date>2023-05-02T13:47:35Z</dc:date>
    <item>
      <title>How to remove decimal value  from values in a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-remove-decimal-value-from-values-in-a-table/m-p/641963#M222380</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;
&lt;P&gt;I need your help for something, please.&lt;/P&gt;
&lt;P&gt;I need to remove the decimal value for this fields:&lt;/P&gt;
&lt;P&gt;- &lt;STRONG&gt;total&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;- &lt;STRONG&gt;hier&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="anissabnk_1-1683011071227.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/25176iFAA77DB5815653D7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="anissabnk_1-1683011071227.png" alt="anissabnk_1-1683011071227.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;My spl request is :&lt;/P&gt;
&lt;P&gt;| union [ search index="pasrau_statuts_count" libelle IN ("Envoi SNGI OK", "Envoi SNGI KO", "RECU")&lt;BR /&gt;| lookup lk_etapes_pasrau_2020_rj libelle output evenement, ordre ]&lt;BR /&gt;| join type=outer libelle [ search index=pasrau_statuts_count earliest=-100d@d latest=@d libelle IN ("Envoi SNGI OK", "Envoi SNGI KO", "RECU") | eval hier=count | table libelle hier ]&lt;BR /&gt;| eval delta=case(hier &amp;lt; count, "+".(count-hier), hier &amp;gt; count, "-".(hier-count), hier=count, "0")&lt;BR /&gt;| eval libelle=ordre+libelle, total=ordre+"."+count, hier=ordre+"."+hier&lt;BR /&gt;| dedup libelle sortby lookup |stats list(libelle) as libelle , list(total) as total list(hier) as hier list(delta) as "DeltaJ/J-1" by evenement&lt;BR /&gt;| sort libelle&lt;BR /&gt;|rex field=libelle mode=sed "s/^[0-9]+//g"&lt;BR /&gt;|rex field=total mode=sed "s/^[0-9]\.+//g"&lt;BR /&gt;|rex field=hier mode=sed "s/^[0-9]\.+//g"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you so much&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2023 13:47:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-remove-decimal-value-from-values-in-a-table/m-p/641963#M222380</guid>
      <dc:creator>anissabnk</dc:creator>
      <dc:date>2023-05-02T13:47:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove decimal value  from values in a table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-remove-decimal-value-from-values-in-a-table/m-p/641966#M222383</link>
      <description>&lt;P&gt;Do you mean&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/MathematicalFunctions#round.28.26lt.3Bnum.26gt.3B.2C.26lt.3Bprecision.26gt.3B.29" target="_blank" rel="noopener"&gt;round&lt;/A&gt;&amp;nbsp;or&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/MathematicalFunctions#floor.28.26lt.3Bnum.26gt.3B.29" target="_blank" rel="noopener"&gt;floor&lt;/A&gt;? &amp;nbsp;For example,&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| union [ search index="pasrau_statuts_count" libelle IN ("Envoi SNGI OK", "Envoi SNGI KO", "RECU")
| lookup lk_etapes_pasrau_2020_rj libelle output evenement, ordre ]
| join type=outer libelle [ search index=pasrau_statuts_count earliest=-100d@d latest=@d libelle IN ("Envoi SNGI OK", "Envoi SNGI KO", "RECU") | eval hier=count | table libelle hier ]
| eval delta=case(hier &amp;lt; count, "+".(count-hier), hier &amp;gt; count, "-".(hier-count), hier=count, "0")
| eval libelle=ordre+libelle, total=ordre+"."+count, hier=ordre+"."+hier
| dedup libelle sortby lookup |stats list(libelle) as libelle , list(total) as total list(hier) as hier list(delta) as "DeltaJ/J-1" by evenement
| sort libelle
| eval libelle = round(libelle)
| eval total = round(total)
| eval hier = round(hier)&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 02 May 2023 07:35:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-remove-decimal-value-from-values-in-a-table/m-p/641966#M222383</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-05-02T07:35:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove decimal value  from values in a table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-remove-decimal-value-from-values-in-a-table/m-p/641974#M222386</link>
      <description>&lt;P&gt;Unfortunately, it doesn't work&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="anissabnk_0-1683016481627.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/25180iE173D5F7FC1E281C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="anissabnk_0-1683016481627.png" alt="anissabnk_0-1683016481627.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2023 08:34:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-remove-decimal-value-from-values-in-a-table/m-p/641974#M222386</guid>
      <dc:creator>anissabnk</dc:creator>
      <dc:date>2023-05-02T08:34:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove decimal value  from values in a table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-remove-decimal-value-from-values-in-a-table/m-p/642086#M222422</link>
      <description>&lt;P&gt;Can you explain what is the desired result? &amp;nbsp;I see that Total is now "11". &amp;nbsp;No decimals. &amp;nbsp;What is the value that you are looking for?&lt;/P&gt;</description>
      <pubDate>Wed, 03 May 2023 03:33:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-remove-decimal-value-from-values-in-a-table/m-p/642086#M222422</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-05-03T03:33:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove decimal value  from values in a table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-remove-decimal-value-from-values-in-a-table/m-p/642101#M222427</link>
      <description>&lt;P&gt;Yes but the other values for &lt;STRONG&gt;total&lt;/STRONG&gt; have disappeared&lt;/P&gt;</description>
      <pubDate>Wed, 03 May 2023 07:18:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-remove-decimal-value-from-values-in-a-table/m-p/642101#M222427</guid>
      <dc:creator>anissabnk</dc:creator>
      <dc:date>2023-05-03T07:18:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove decimal value  from values in a table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-remove-decimal-value-from-values-in-a-table/m-p/642111#M222431</link>
      <description>&lt;P&gt;OK. Let's start by saying that what you're doing with your multivalued fields is not a good practice.&lt;/P&gt;&lt;P&gt;You have several separate multivalued fields on which order you probably rely (in your case the value of Envoi SNG1 OK probably should correspond to the first values in other fields and the second values should contain values regarding Envoi SNG1 KO. In some cases it might work this way but in general, there's no way of telling which ones are which - multivalued fields are independent and their order is independent. While your search which does not do much after stats list() should preserve the order of values, you might get into trouble if for some reason some of the values would turn out empty. Splunk would "squish" the remaining values and you would have no way of knowing which values from one field would correspond to which from the other field.&lt;/P&gt;&lt;P&gt;Another thing is your use of the &lt;EM&gt;union&lt;/EM&gt; command. One thing is the command itself (which should be avoided if possible) but another thing is that you have just one subsearch in your union call. So what's the point of the command in the first place?&lt;/P&gt;&lt;P&gt;Also, use of &lt;EM&gt;join&lt;/EM&gt; should be avoided if possible. On small data sets it might be the easiest way to get your results and that's perfectly fine but if you have bigger sets of results to "join", you'd better find another method - typically by means of clever stats usage.&lt;/P&gt;&lt;P&gt;So the question is what data you have and what do you want to get from it. There's most probably a more efficient way to do it. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 May 2023 09:19:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-remove-decimal-value-from-values-in-a-table/m-p/642111#M222431</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2023-05-03T09:19:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove decimal value  from values in a table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-remove-decimal-value-from-values-in-a-table/m-p/642205#M222463</link>
      <description>&lt;P&gt;So, total is multivalued. &amp;nbsp;Easy&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| union [ search index="pasrau_statuts_count" libelle IN ("Envoi SNGI OK", "Envoi SNGI KO", "RECU")
| lookup lk_etapes_pasrau_2020_rj libelle output evenement, ordre ]
| join type=outer libelle [ search index=pasrau_statuts_count earliest=-100d@d latest=@d libelle IN ("Envoi SNGI OK", "Envoi SNGI KO", "RECU") | eval hier=count | table libelle hier ]
| eval delta=case(hier &amp;lt; count, "+".(count-hier), hier &amp;gt; count, "-".(hier-count), hier=count, "0")
| eval libelle=ordre+libelle, total=ordre+"."+count, hier=ordre+"."+hier
| dedup libelle sortby lookup |stats list(libelle) as libelle , list(total) as total list(hier) as hier list(delta) as "DeltaJ/J-1" by evenement
| sort libelle
| eval libelle = mvmap(libelle, round(libelle))
| eval total = mvmap(total, round(total))
| eval hier = mvmap(hier, round(hier))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 May 2023 00:03:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-remove-decimal-value-from-values-in-a-table/m-p/642205#M222463</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-05-04T00:03:37Z</dc:date>
    </item>
  </channel>
</rss>

