<?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: How to get number from the text string in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-get-number-from-the-text-string/m-p/1591506#M737741</link>
    <description>In perfect world it will works but unfortunnetly not always I have space beetwen M and next values... sometimes it is somthing looks like space but it it isn't...&lt;BR /&gt;For example for below string your function return RC=INV i don't know why.&lt;BR /&gt;RC=INV&lt;BR /&gt;RQ=C&lt;BR /&gt;PCR=R&lt;BR /&gt;V#=1&lt;BR /&gt;#&lt;BR /&gt;&lt;BR /&gt;But thank you , good to know that exist function like subfield . &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Thu, 13 Jun 2019 10:46:45 GMT</pubDate>
    <dc:creator>maly0606</dc:creator>
    <dc:date>2019-06-13T10:46:45Z</dc:date>
    <item>
      <title>How to get number from the text string</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-number-from-the-text-string/m-p/1591358#M737736</link>
      <description>&lt;P&gt;Hello ,&lt;/P&gt;&lt;P&gt;I wanna get from the string&amp;nbsp; value for M#&amp;nbsp;&lt;/P&gt;&lt;P&gt;and I did it but I am wondering whether exist any simpler way to get the same result&lt;/P&gt;&lt;P&gt;Below examples of the strings, I have on the left and right side I have text, below you can see only the part of the text which I am interested in.&lt;/P&gt;&lt;P&gt;#%%# RC=Material characteristic RQ=C PCR= M#=207 #%%#&lt;BR /&gt;#%%# RC=PIR &amp;amp; SL one off request RQ=C PCR= M#=1 G#=1 #%%#&lt;/P&gt;&lt;P&gt;And in SQL&amp;nbsp; I write&amp;nbsp;&lt;/P&gt;&lt;P&gt;Case when CHARINDEX('M#=',Description)&amp;lt;1 then 'N/A'&lt;BR /&gt;else rtrim(upper(SUBSTRING(Description,CHARINDEX('M#=',Description)+3,5&lt;BR /&gt;))) end as M#&lt;/P&gt;&lt;P&gt;and in Qlik I add&amp;nbsp;&lt;/P&gt;&lt;P&gt;KeepChar(M#,'0123456789') as M#,&lt;/P&gt;&lt;P&gt;And it works only for values &amp;lt; 99999&amp;nbsp; maybe do you know more flexible solution ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much for any suggestions&lt;/P&gt;&lt;P&gt;Marcin&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-number-from-the-text-string/m-p/1591358#M737736</guid>
      <dc:creator>maly0606</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to get number from the text string</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-number-from-the-text-string/m-p/1591366#M737737</link>
      <description>&lt;P&gt;Hi! I solved it using only Qlik functions (no SQL processing) but I supposed that after 'M#=&lt;EM&gt;NUMBERS&lt;/EM&gt;' goes a blank space. The expression I used is&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;=SubField(Mid(string, Index(string, 'M#')), ' ', 1)&lt;/LI-CODE&gt;&lt;P&gt;where "string" is the complete string. It works with the examples you provided. Let me know if it works!&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jaime.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2019 06:47:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-number-from-the-text-string/m-p/1591366#M737737</guid>
      <dc:creator>jaibau1993</dc:creator>
      <dc:date>2019-06-13T06:47:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to get number from the text string</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-number-from-the-text-string/m-p/1591371#M737738</link>
      <description>&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;I am not sure why keepchar does not work for you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2019 06:51:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-number-from-the-text-string/m-p/1591371#M737738</guid>
      <dc:creator>anushree1</dc:creator>
      <dc:date>2019-06-13T06:51:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to get number from the text string</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-number-from-the-text-string/m-p/1591379#M737739</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/4168"&gt;@jaibau1993&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;Hi! I solved it using only Qlik functions (no SQL processing) but I supposed that after 'M#=&lt;EM&gt;NUMBERS&lt;/EM&gt;' goes a blank space. The expression I used is&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;=SubField(Mid(string, Index(string, 'M#')), ' ', 1)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;where "string" is the complete string. It works with the examples you provided. Let me know if it works!&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jaime.&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;HR /&gt;&lt;P&gt;Great Jaime!&lt;/P&gt;&lt;P&gt;This expression will return a string including the 'M#=' if you want to exclude the M#= you&amp;nbsp; can adjust it like this;´:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;=SubField( Mid(String, Index(String, 'M#') +3 ), ' ', 1)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- Vegar&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2019 07:15:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-number-from-the-text-string/m-p/1591379#M737739</guid>
      <dc:creator>Vegar</dc:creator>
      <dc:date>2019-06-13T07:15:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to get number from the text string</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-number-from-the-text-string/m-p/1591494#M737740</link>
      <description>&lt;P&gt;In sql i cut from string 5 chars and i below case i have&amp;nbsp;&amp;nbsp;10210 it is wrong because I wanna have&amp;nbsp;102101&amp;nbsp;&lt;/P&gt;&lt;P&gt;SUBSTRING(Description,CHARINDEX('M#=',Description)+3,5)&lt;/P&gt;&lt;P&gt;#%%# RC=PIR &amp;amp; SL one off request RQ=C PCR= M#=102101 G#=1 #%%#&lt;/P&gt;&lt;P&gt;------- so when I changed 3 argument in substring function from 5&amp;nbsp; to 6 i get proper resoult for values more than 99999 but for the rest of values for example '3' i got&amp;nbsp; string '3&amp;nbsp;G#=1' by the keep function result will be 31..&amp;nbsp;&lt;/P&gt;&lt;P&gt;SUBSTRING(Description,CHARINDEX('M#=',Description)+3,6)&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2019 10:26:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-number-from-the-text-string/m-p/1591494#M737740</guid>
      <dc:creator>maly0606</dc:creator>
      <dc:date>2019-06-13T10:26:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to get number from the text string</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-number-from-the-text-string/m-p/1591506#M737741</link>
      <description>In perfect world it will works but unfortunnetly not always I have space beetwen M and next values... sometimes it is somthing looks like space but it it isn't...&lt;BR /&gt;For example for below string your function return RC=INV i don't know why.&lt;BR /&gt;RC=INV&lt;BR /&gt;RQ=C&lt;BR /&gt;PCR=R&lt;BR /&gt;V#=1&lt;BR /&gt;#&lt;BR /&gt;&lt;BR /&gt;But thank you , good to know that exist function like subfield . &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 13 Jun 2019 10:46:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-number-from-the-text-string/m-p/1591506#M737741</guid>
      <dc:creator>maly0606</dc:creator>
      <dc:date>2019-06-13T10:46:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to get number from the text string</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-number-from-the-text-string/m-p/1591518#M737742</link>
      <description>&lt;P&gt;Hi, that particular case is because there is no M# and it gets 6 characters starting at char zero, you can add a check:&lt;/P&gt;&lt;P&gt;If(Index(String, 'M#')=0, 'N/A', [expression])&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2019 10:59:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-number-from-the-text-string/m-p/1591518#M737742</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2019-06-13T10:59:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to get number from the text string</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-number-from-the-text-string/m-p/1591661#M737743</link>
      <description>&lt;LI-CODE lang="javascript"&gt;t:
LOAD
*,
if(isNum(temp),temp,Left(temp,FindOneOf(temp,PurgeChar(temp, '0123456789'))-1)) as M#
;
LOAD
*,
if(index(F1,'M#=')&amp;gt;0,Right(F1, Len(F1)-Index(F1,'M#=')-2),' ') as temp
INLINE [
    F1
    #%%# RC=Material characteristic RQ=C PCR= M#=207 #%%#
    #%%# RC=Material characteristic M#=999999 RQ=C PCR=345 #%%#
    #%%# RC=Material characteristic RQ=C PCR=345 M#= #%%#
    #%%# RC=PIR &amp;amp; SL one off request RQ=C PCR= M#=1 G#=1 #%%#
    #%%# RC=PIR &amp;amp; SL one off request RQ=C PCR= G#=9 #%%#
    #%%# RC=Material characteristic RQ=C PCR= M#=211
    #%%# RC=Material characteristic RQ=C PCR= M#=987654#%%#
    #%%# RC=PIR &amp;amp; SL one off request RQ=C PCR= M#=7G#=1 #%%#
    M#=55588899
    12345678
];&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Result:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Untitled.png" style="width: 442px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/13727iB5B5D86D331C1307/image-size/large?v=v2&amp;amp;px=999" role="button" title="Untitled.png" alt="Untitled.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;- Christian&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2019 14:05:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-number-from-the-text-string/m-p/1591661#M737743</guid>
      <dc:creator>cwolf</dc:creator>
      <dc:date>2019-06-13T14:05:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to get number from the text string</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-number-from-the-text-string/m-p/1591934#M737744</link>
      <description>&lt;P&gt;It works perfect, thanks &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jun 2019 08:02:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-number-from-the-text-string/m-p/1591934#M737744</guid>
      <dc:creator>maly0606</dc:creator>
      <dc:date>2019-06-14T08:02:16Z</dc:date>
    </item>
  </channel>
</rss>

