<?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: RegExp or alternative in Connectivity &amp; Data Prep</title>
    <link>https://community.qlik.com/t5/Connectivity-Data-Prep/RegExp-or-alternative/m-p/2506764#M14619</link>
    <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/6148"&gt;@rwunderlich&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can get that working now, which is a relief, though it doesn't appear to work in a "group by" load function.&lt;/P&gt;
&lt;P&gt;I've just used a staging table to get around this.&lt;/P&gt;</description>
    <pubDate>Thu, 20 Feb 2025 09:54:58 GMT</pubDate>
    <dc:creator>Oggy172</dc:creator>
    <dc:date>2025-02-20T09:54:58Z</dc:date>
    <item>
      <title>RegExp or alternative</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/RegExp-or-alternative/m-p/2506658#M14612</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;I am doing some work in QV, and need to pull a 7 digit number from a string.&lt;/P&gt;
&lt;P&gt;I had a look around and there's references to two solutions, neither of which seem to work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Solution1 -&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.qlikfix.com/2010/10/18/regular-expressions-in-the-load-script/" target="_blank" rel="noopener"&gt;http://www.qlikfix.com/2010/10/18/regular-expressions-in-the-load-script/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Even running the sample RegEx.qvw provided on the URL, I get an error&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Oggy172_0-1739982973738.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/177708iF9D0854E369A18F3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Oggy172_0-1739982973738.png" alt="Oggy172_0-1739982973738.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I get a very similar error when used in my app.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I also came across this Javascript variant&amp;nbsp; - Solution 2&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.qlik.com/t5/QlikView-App-Dev/String-extraction/td-p/1885442" target="_blank" rel="noopener"&gt;Solved: String extraction - Qlik Community - 1885442&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Editing it to&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;function GetRegExp(s){
	var m = s.match(/\d{7}/);
	return m==null ? "" : m[0];
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This fails.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the section of my load script&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;ReturnsDetail:
load
GetRegExp ([Advice Note No]) as RegexTest,
[Stock Code],
[Expiry Date], 
sum([Previous Qty])	as Cases,
count(distinct [Container Id]) as Plt,
'Oggy' as [Source]
from 
'$(FoundFile)'
(ooxml, embedded labels, table is [DETAIL])
GROUP BY [Stock Code], [Expiry Date], GetRegExp ([Advice Note No]);&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Which errors on "Invalid Expression"&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Oggy172_1-1739983796875.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/177710i711FCAB7E159BC51/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Oggy172_1-1739983796875.png" alt="Oggy172_1-1739983796875.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I noted the table name is asterixed out, but if I remove the GetRegExp line, it rund through fine.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ideally I'd like to get RegExp working, but, is there another way of searching for a 7 digit consecutive number in a variable length field?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2025 16:54:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/RegExp-or-alternative/m-p/2506658#M14612</guid>
      <dc:creator>Oggy172</dc:creator>
      <dc:date>2025-02-19T16:54:43Z</dc:date>
    </item>
    <item>
      <title>Re: RegExp or alternative</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/RegExp-or-alternative/m-p/2506667#M14614</link>
      <description>&lt;P&gt;You can use RegEx as shown in QlikView Macro example. It's just that the example script is a bit out of sync with the Macro example. The Macro Functions are expecting a third parameter to indicate case sensitive match. You can modify the script example lines to provide the third parm:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;if(RegExTest([Phone number], '^\d{3}-\d{4}', False())&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;or modify the macro.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Here's another example of QV Regex:&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;A href="https://qlikviewcookbook.com/recipes/download-info/regular-expression-pattern-matching/" target="_blank"&gt;https://qlikviewcookbook.com/recipes/download-info/regular-expression-pattern-matching/&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;-Rob&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2025 18:11:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/RegExp-or-alternative/m-p/2506667#M14614</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2025-02-19T18:11:09Z</dc:date>
    </item>
    <item>
      <title>Re: RegExp or alternative</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/RegExp-or-alternative/m-p/2506764#M14619</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/6148"&gt;@rwunderlich&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can get that working now, which is a relief, though it doesn't appear to work in a "group by" load function.&lt;/P&gt;
&lt;P&gt;I've just used a staging table to get around this.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Feb 2025 09:54:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/RegExp-or-alternative/m-p/2506764#M14619</guid>
      <dc:creator>Oggy172</dc:creator>
      <dc:date>2025-02-20T09:54:58Z</dc:date>
    </item>
    <item>
      <title>Re: RegExp or alternative</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/RegExp-or-alternative/m-p/2506802#M14620</link>
      <description>&lt;P&gt;For all who are quite comfortable with the regex-syntax and mainly be able just to write them down without much efforts or investigating it's surely a convinient way to extract/check sub-strings.&lt;/P&gt;
&lt;P&gt;But regex is seldom mandatory within Qlik because there are a lot of powerful string- and conversion-functions and the shown transformations are not very difficult to get within Qlik, for example using date#() to convert a date-string. This means there are inbuilt alternatives to a regex - not so nicely but be working.&lt;/P&gt;
&lt;P&gt;If I remember correctly I used already transformations within a group by - you may move this part to a preceding- or a resident-load.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Feb 2025 13:54:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/RegExp-or-alternative/m-p/2506802#M14620</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2025-02-20T13:54:56Z</dc:date>
    </item>
  </channel>
</rss>

