<?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 Incorta formula in Dashboards &amp; Analytics Discussions</title>
    <link>https://community.incorta.com/t5/dashboards-analytics-discussions/incorta-formula/m-p/1855#M119</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi Team - Wondering whether below oracle Sql can be achieved using Incorta formula?&lt;/P&gt;&lt;P&gt;segment1 is the input&lt;/P&gt;&lt;P&gt;formula_required is the output.&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;EM&gt;select segment1, substr(segment1,1,(length(segment1)-instr(reverse(segment1),'-'))) AS formula_required from dual;&lt;/EM&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sample input and output&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE width="250"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="132"&gt;Segment1&lt;/TD&gt;&lt;TD width="118"&gt;formula_required&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;9211-5082&lt;/TD&gt;&lt;TD&gt;9211&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;86062C-C16-SPS&lt;/TD&gt;&lt;TD&gt;86062C-C16&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;U2653A-ACF&lt;/TD&gt;&lt;TD&gt;U2653A&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;U2652A-OC-INCDOC&lt;/TD&gt;&lt;TD&gt;U2652A-OC&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Note : Basically it has to print the characters before the last '-'&lt;/P&gt;</description>
    <pubDate>Wed, 08 Jun 2022 11:00:29 GMT</pubDate>
    <dc:creator>Incortaconsulta</dc:creator>
    <dc:date>2022-06-08T11:00:29Z</dc:date>
    <item>
      <title>Incorta formula</title>
      <link>https://community.incorta.com/t5/dashboards-analytics-discussions/incorta-formula/m-p/1855#M119</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi Team - Wondering whether below oracle Sql can be achieved using Incorta formula?&lt;/P&gt;&lt;P&gt;segment1 is the input&lt;/P&gt;&lt;P&gt;formula_required is the output.&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;EM&gt;select segment1, substr(segment1,1,(length(segment1)-instr(reverse(segment1),'-'))) AS formula_required from dual;&lt;/EM&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sample input and output&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE width="250"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="132"&gt;Segment1&lt;/TD&gt;&lt;TD width="118"&gt;formula_required&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;9211-5082&lt;/TD&gt;&lt;TD&gt;9211&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;86062C-C16-SPS&lt;/TD&gt;&lt;TD&gt;86062C-C16&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;U2653A-ACF&lt;/TD&gt;&lt;TD&gt;U2653A&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;U2652A-OC-INCDOC&lt;/TD&gt;&lt;TD&gt;U2652A-OC&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Note : Basically it has to print the characters before the last '-'&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jun 2022 11:00:29 GMT</pubDate>
      <guid>https://community.incorta.com/t5/dashboards-analytics-discussions/incorta-formula/m-p/1855#M119</guid>
      <dc:creator>Incortaconsulta</dc:creator>
      <dc:date>2022-06-08T11:00:29Z</dc:date>
    </item>
    <item>
      <title>Re: Incorta formula</title>
      <link>https://community.incorta.com/t5/dashboards-analytics-discussions/incorta-formula/m-p/1858#M120</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.incorta.com/t5/user/viewprofilepage/user-id/317"&gt;@Incortaconsulta&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I was able to replicate this functionality using the substring and findLast functions in the formula builder. This formula performs a substring starting at position 0, and then uses the findLast function to find the position of the last dash in the string, and ends the string there.&lt;/P&gt;
&lt;P&gt;The example below shows the formula in an insight, but the same formula can be used in the Schema or Business Schema areas if you want to persist the results for others to use without having to type the formula every time in an insight.&lt;/P&gt;
&lt;P&gt;I included your examples in the sample data, and I added an extra example with three dashes so you could see that it still works with more than two dashes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;substring(
	Community_Questions.StringQuestion06082022.Sample_Data, 
	0, 
	(findLast(
		"-", 
		Community_Questions.StringQuestion06082022.Sample_Data
	))
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="michael_ross_0-1654693623879.png" style="width: 400px;"&gt;&lt;img src="https://community.incorta.com/t5/image/serverpage/image-id/1098i5423746AA92BC3E1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="michael_ross_0-1654693623879.png" alt="michael_ross_0-1654693623879.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jun 2022 13:22:56 GMT</pubDate>
      <guid>https://community.incorta.com/t5/dashboards-analytics-discussions/incorta-formula/m-p/1858#M120</guid>
      <dc:creator>michael_ross</dc:creator>
      <dc:date>2022-06-08T13:22:56Z</dc:date>
    </item>
    <item>
      <title>Re: Incorta formula</title>
      <link>https://community.incorta.com/t5/dashboards-analytics-discussions/incorta-formula/m-p/1896#M121</link>
      <description>&lt;P&gt;Hi Mike - It worked like a gem, Kudos and thanks !!&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2022 05:19:38 GMT</pubDate>
      <guid>https://community.incorta.com/t5/dashboards-analytics-discussions/incorta-formula/m-p/1896#M121</guid>
      <dc:creator>Incortaconsulta</dc:creator>
      <dc:date>2022-06-10T05:19:38Z</dc:date>
    </item>
  </channel>
</rss>

