<?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: Count leading spaces in a string in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Count-leading-spaces-in-a-string/m-p/698370#M673117</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;maybe this thread is also of interest for you:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/thread/125041"&gt;loading data&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 04 Sep 2014 16:08:42 GMT</pubDate>
    <dc:creator>MarcoWedel</dc:creator>
    <dc:date>2014-09-04T16:08:42Z</dc:date>
    <item>
      <title>Count leading spaces in a string</title>
      <link>https://community.qlik.com/t5/QlikView/Count-leading-spaces-in-a-string/m-p/698367#M673114</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello! Sorry in advance for my english.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is my question: I would like to import data from an Excel file containing one column ("Siege") with leading spaces records.&lt;/P&gt;&lt;P&gt;But while loading data into qlikview, leading spaces are automatically suppressed even using Text() function:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;...&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;Text(Siege) as Siege,&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The workaround I found is to modify the "Verbatim" variable before loading data and it works fine :&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;Set Verbatim = 0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To count spaces of each record, i created a new column using :&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;substringcount(Siege,' ') as Hierarchie,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="65804" alt="Capture2.PNG.png" class="jive-image" src="https://community.qlik.com/legacyfs/online/65804_Capture2.PNG.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can retrieve the correct number of leading spaces for the first three records. It doesn't work for the last one because i don't want to count space between 'S4' and 'London' but &lt;SPAN style="text-decoration: underline;"&gt;only before 'S4'.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;So how can I only count leading spaces in a string ??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank You for your help &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Sep 2014 10:00:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-leading-spaces-in-a-string/m-p/698367#M673114</guid>
      <dc:creator>bfournet</dc:creator>
      <dc:date>2014-09-03T10:00:51Z</dc:date>
    </item>
    <item>
      <title>Re: Count leading spaces in a string</title>
      <link>https://community.qlik.com/t5/QlikView/Count-leading-spaces-in-a-string/m-p/698368#M673115</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;( len(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Siege&lt;/SPAN&gt;) - (len( ltrim(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Siege&lt;/SPAN&gt;))))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Sep 2014 10:15:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-leading-spaces-in-a-string/m-p/698368#M673115</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-09-03T10:15:27Z</dc:date>
    </item>
    <item>
      <title>Re: Count leading spaces in a string</title>
      <link>https://community.qlik.com/t5/QlikView/Count-leading-spaces-in-a-string/m-p/698369#M673116</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, it works fine and the solution more simple than I expected &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Sep 2014 15:38:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-leading-spaces-in-a-string/m-p/698369#M673116</guid>
      <dc:creator>bfournet</dc:creator>
      <dc:date>2014-09-04T15:38:00Z</dc:date>
    </item>
    <item>
      <title>Re: Count leading spaces in a string</title>
      <link>https://community.qlik.com/t5/QlikView/Count-leading-spaces-in-a-string/m-p/698370#M673117</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;maybe this thread is also of interest for you:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/thread/125041"&gt;loading data&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Sep 2014 16:08:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-leading-spaces-in-a-string/m-p/698370#M673117</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2014-09-04T16:08:42Z</dc:date>
    </item>
  </channel>
</rss>

