<?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 split a field based on a fixed number of bytes in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-split-a-field-based-on-a-fixed-number-of-bytes/m-p/2003937#M1221478</link>
    <description>&lt;P&gt;hi all，&lt;/P&gt;
&lt;P&gt;i want to split a field to some fields，&lt;SPAN&gt;E.g：&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;text &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;1如23 split to&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt; &amp;nbsp;1&amp;nbsp; &amp;nbsp;如&amp;nbsp; &amp;nbsp; &amp;nbsp;23&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;i want use mid（）to run it but i found that&amp;nbsp; it failed。&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;mid（text，2，2）&amp;nbsp;&amp;nbsp;it shows that&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;如2&amp;nbsp; .&amp;nbsp; it's wrong.it should be 如.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;so，i want to split a field based on a fixed number of bytes，can you help me，thanks！&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 14 Nov 2022 07:40:11 GMT</pubDate>
    <dc:creator>LRAngela</dc:creator>
    <dc:date>2022-11-14T07:40:11Z</dc:date>
    <item>
      <title>How to split a field based on a fixed number of bytes</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-split-a-field-based-on-a-fixed-number-of-bytes/m-p/2003937#M1221478</link>
      <description>&lt;P&gt;hi all，&lt;/P&gt;
&lt;P&gt;i want to split a field to some fields，&lt;SPAN&gt;E.g：&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;text &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;1如23 split to&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt; &amp;nbsp;1&amp;nbsp; &amp;nbsp;如&amp;nbsp; &amp;nbsp; &amp;nbsp;23&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;i want use mid（）to run it but i found that&amp;nbsp; it failed。&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;mid（text，2，2）&amp;nbsp;&amp;nbsp;it shows that&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;如2&amp;nbsp; .&amp;nbsp; it's wrong.it should be 如.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;so，i want to split a field based on a fixed number of bytes，can you help me，thanks！&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Nov 2022 07:40:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-split-a-field-based-on-a-fixed-number-of-bytes/m-p/2003937#M1221478</guid>
      <dc:creator>LRAngela</dc:creator>
      <dc:date>2022-11-14T07:40:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to split a field based on a fixed number of bytes</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-split-a-field-based-on-a-fixed-number-of-bytes/m-p/2003942#M1221479</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;In ur sample, try like&amp;nbsp;Mid('1如23',2,1) &amp;lt;-- it gives expected result.&lt;/P&gt;
&lt;P&gt;However, if you want dynamic, if always first character is number, you can split the in-between letters, then try like below&lt;/P&gt;
&lt;P&gt;=mid('1如23', 2 , FindOneOf(mid('1如23',2), 1234567890)-1)&lt;/P&gt;</description>
      <pubDate>Mon, 14 Nov 2022 07:52:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-split-a-field-based-on-a-fixed-number-of-bytes/m-p/2003942#M1221479</guid>
      <dc:creator>MayilVahanan</dc:creator>
      <dc:date>2022-11-14T07:52:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to split a field based on a fixed number of bytes</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-split-a-field-based-on-a-fixed-number-of-bytes/m-p/2003986#M1221480</link>
      <description>&lt;P&gt;Thank you for your help, but mine is more complicated.&lt;/P&gt;
&lt;P&gt;The first character is not sure, and the number of Chinese characters in the middle is not sure, but the start byte position and end position of Chinese are certain. So I want a function that can be intercepted according to the byte, is there a way.&lt;/P&gt;
&lt;P&gt;eg:&amp;nbsp; the field is test ,&amp;nbsp;start byte position is 2&amp;nbsp; &amp;nbsp;end position is&amp;nbsp; 10&lt;/P&gt;
&lt;P&gt;test&lt;/P&gt;
&lt;P&gt;1如果还有&amp;nbsp; 3456&lt;/P&gt;
&lt;P&gt;a如果&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 7890&lt;/P&gt;
&lt;P&gt;c如&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; a&lt;/P&gt;
&lt;P&gt;I have tried many methods but can't solve it, because this position is calculated by the number of bytes, not the number of characters, and mid() is intercepted by characters, so it can't be solved.&lt;/P&gt;
&lt;P&gt;thanks&amp;nbsp; a lot&lt;/P&gt;</description>
      <pubDate>Mon, 14 Nov 2022 08:56:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-split-a-field-based-on-a-fixed-number-of-bytes/m-p/2003986#M1221480</guid>
      <dc:creator>LRAngela</dc:creator>
      <dc:date>2022-11-14T08:56:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to split a field based on a fixed number of bytes</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-split-a-field-based-on-a-fixed-number-of-bytes/m-p/2004032#M1221485</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;If you want to get only the Chinese characters, try with Purgechar() functionality like below&lt;/P&gt;
&lt;P&gt;LOAD *, PurgeChar(test, '0123456789abcdefghijklmnopqrstuvwxyz') as chinesetest INLINE [&lt;BR /&gt;test&lt;BR /&gt;&lt;BR /&gt;1如果还有 3456&lt;BR /&gt;&lt;BR /&gt;a如果 7890&lt;BR /&gt;&lt;BR /&gt;c如 a&lt;BR /&gt;];&lt;/P&gt;</description>
      <pubDate>Mon, 14 Nov 2022 10:30:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-split-a-field-based-on-a-fixed-number-of-bytes/m-p/2004032#M1221485</guid>
      <dc:creator>MayilVahanan</dc:creator>
      <dc:date>2022-11-14T10:30:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to split a field based on a fixed number of bytes</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-split-a-field-based-on-a-fixed-number-of-bytes/m-p/2004351#M1221494</link>
      <description>&lt;P&gt;&lt;SPAN&gt;It is not just Chinese characters, the part to be intercepted is actually the address, there may be numbers, etc., so it needs to be intercepted according to the byte position&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Nov 2022 01:36:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-split-a-field-based-on-a-fixed-number-of-bytes/m-p/2004351#M1221494</guid>
      <dc:creator>LRAngela</dc:creator>
      <dc:date>2022-11-15T01:36:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to split a field based on a fixed number of bytes</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-split-a-field-based-on-a-fixed-number-of-bytes/m-p/2004519#M1221497</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;Can you say the expected output for below?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;test&lt;/P&gt;
&lt;P&gt;1如果还有&amp;nbsp; 3456&lt;/P&gt;
&lt;P&gt;a如果&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 7890&lt;/P&gt;
&lt;P&gt;c如&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; a&lt;/P&gt;</description>
      <pubDate>Tue, 15 Nov 2022 09:40:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-split-a-field-based-on-a-fixed-number-of-bytes/m-p/2004519#M1221497</guid>
      <dc:creator>MayilVahanan</dc:creator>
      <dc:date>2022-11-15T09:40:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to split a field based on a fixed number of bytes</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-split-a-field-based-on-a-fixed-number-of-bytes/m-p/2004847#M1221505</link>
      <description>&lt;P&gt;I think I would check and categorize each char and would be starting by:&lt;/P&gt;
&lt;P&gt;load *, if(CharID &amp;gt;= n1 and CharID &amp;lt;= n2, 'Number/AlphaNumeric/Chinese/Others', ... as CharCategory;&lt;BR /&gt;load *, len(Text) as Len, ord(Char) as CharID;&lt;BR /&gt;load Text, mid(Text, iterno(), 1) as Char, recno() as RecNo, iterno() as IterNo&lt;BR /&gt;from Source while len(Text) &amp;lt;= iterno();&lt;/P&gt;
&lt;P&gt;Instead of a nested if-loop for the categorizing you may use a mapping. In further steps you may read the first/last char from each category, count their amount and so on to classify their content and with this information you may concat() the Char's in the end again.&lt;/P&gt;
&lt;P&gt;Especially if there is a high variety of different content you will need a systematically approach with rather less (nested) if-loops to cut and pick here and there the relevant stuff. Further depending on the data-quality you may not be able to resolve all data - **bleep** in = **bleep** out ...&lt;/P&gt;
&lt;P&gt;- Marcus&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Nov 2022 16:12:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-split-a-field-based-on-a-fixed-number-of-bytes/m-p/2004847#M1221505</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2022-11-15T16:12:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to split a field based on a fixed number of bytes</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-split-a-field-based-on-a-fixed-number-of-bytes/m-p/2005023#M1221509</link>
      <description>&lt;P&gt;Generally speaking, I have a text file, in which each line of data is a combination of multiple fields, in which the number of bytes is 200 to 300 for the field address, and if the length is less than 100, it will be represented by a space. I just want to intercept the adress by the number of bytes, but i dont konw the function that can help me&lt;/P&gt;
&lt;P&gt;solve this question.&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Currently my script looks like this ：Mid(test, 456,40) as "Transactor CertNo",&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;Mid(test, 496,300) as Address。&lt;/P&gt;
&lt;P&gt;This address is misplaced, because there are other characters in the front that occupy two bytes, so mid() cannot be used, mid() is intercepted according to the character。（"Transactor CertNo" is an empty data field）&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LRAngela_3-1668566283981.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/93826i524253A979DBB43B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LRAngela_3-1668566283981.png" alt="LRAngela_3-1668566283981.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Nov 2022 02:39:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-split-a-field-based-on-a-fixed-number-of-bytes/m-p/2005023#M1221509</guid>
      <dc:creator>LRAngela</dc:creator>
      <dc:date>2022-11-16T02:39:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to split a field based on a fixed number of bytes</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-split-a-field-based-on-a-fixed-number-of-bytes/m-p/2005025#M1221510</link>
      <description>&lt;P&gt;I can't understand what you mean very well, can you give an example or explain it in detail?&lt;/P&gt;
&lt;P&gt;thanks&lt;/P&gt;</description>
      <pubDate>Wed, 16 Nov 2022 02:41:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-split-a-field-based-on-a-fixed-number-of-bytes/m-p/2005025#M1221510</guid>
      <dc:creator>LRAngela</dc:creator>
      <dc:date>2022-11-16T02:41:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to split a field based on a fixed number of bytes</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-split-a-field-based-on-a-fixed-number-of-bytes/m-p/2005209#M1221514</link>
      <description>&lt;P&gt;If you ar loading from text file you can split the line in the load statement. For example:&lt;/P&gt;
&lt;P&gt;LOAD &lt;BR /&gt;[@1:455] as Field1, &lt;BR /&gt;[@456:495] as "Transactor CertNo",&lt;BR /&gt;[@496:795] as Address,&lt;BR /&gt;[@796:n] as Rest&lt;BR /&gt;FROM [.\file.txt](fix, utf8, embedded labels); // file with headerline&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;FROM [.\file.txt](fix, utf8, no labels); // file without headerline&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;@startpos:endpos =&amp;gt; startpos and endpos are byte positions!&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Without a headerline you have to consider the encoding of the file. If it is a utf8 file with signature then the first line has a prefix of 3 bytes. In this case you have to move the first line for 3 Bytes.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Nov 2022 10:50:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-split-a-field-based-on-a-fixed-number-of-bytes/m-p/2005209#M1221514</guid>
      <dc:creator>cwolf</dc:creator>
      <dc:date>2022-11-16T10:50:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to split a field based on a fixed number of bytes</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-split-a-field-based-on-a-fixed-number-of-bytes/m-p/2006177#M1221542</link>
      <description>&lt;P&gt;wow！so cool！it ran successfully。T&lt;SPAN&gt;hank you so much you are amazing。&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Nov 2022 02:00:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-split-a-field-based-on-a-fixed-number-of-bytes/m-p/2006177#M1221542</guid>
      <dc:creator>LRAngela</dc:creator>
      <dc:date>2022-11-18T02:00:56Z</dc:date>
    </item>
  </channel>
</rss>

