<?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: syntax error in my load script in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/syntax-error-in-my-load-script/m-p/1725568#M63973</link>
    <description>&lt;P&gt;You didn't show the error message here. It looks like the LOAD statement is dynamically created in the variable&amp;nbsp;&lt;SPAN&gt;vLoadString. You have to check if there is any syntax error.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 07 Jul 2020 03:13:25 GMT</pubDate>
    <dc:creator>Saravanan_Desingh</dc:creator>
    <dc:date>2020-07-07T03:13:25Z</dc:date>
    <item>
      <title>syntax error in my load script</title>
      <link>https://community.qlik.com/t5/App-Development/syntax-error-in-my-load-script/m-p/1725545#M63972</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I am posting this again as my first post was marked as spam.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a load script the is getting a syntax error, but I can not find it. I am asking the community to see if they might be able to spot it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The Script:&lt;/P&gt;&lt;P&gt;$(vAssociationTableName):&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt;_FactCounter&lt;BR /&gt;1&lt;BR /&gt;] WHERE 1 = 0;&lt;/P&gt;&lt;P&gt;LET vNoOfTables = NoOfTables();&lt;BR /&gt;FOR vTableNumber = 0 to ($(vNoOfTables) -1)&lt;BR /&gt;LET vTableName = TableName($(vTableNumber));&lt;BR /&gt;LET vTempTableName = '$(vTableName)';&lt;BR /&gt;IF Right('$(vTableName)',7) = '_NOLOAD' THEN&lt;BR /&gt;LET vTempTableName = Left('$(vTableName)',(Len('$(vTableName)')-7));&lt;BR /&gt;END IF&lt;BR /&gt;LET vFactFieldName = '_Fact_' &amp;amp; '$(vTempTableName)' &amp;amp; 'Key';&lt;BR /&gt;IF FieldNumber('$(vFactFieldName)','$(vTableName)') &amp;gt; 0 THEN&lt;BR /&gt;LET vLoadString = 'CONCATENATE (' &amp;amp; '$(vAssociationTableName)' &amp;amp; ') ' &amp;amp; Chr(13) &amp;amp; Chr(10) &amp;amp; 'LOAD DISTINCT ' &amp;amp; '$(vFactFieldName)' &amp;amp; Chr(13) &amp;amp; Chr(10);&lt;BR /&gt;LET vNoOfFields = NoOfFields('$(vTableName)');&lt;BR /&gt;FOR vFieldNumber = 1 to $(vNoOfFields)&lt;BR /&gt;LET vFieldName = FieldName($(vFieldNumber), '$(vTableName)');&lt;BR /&gt;IF Left('$(vFieldName)',1) = '_' AND Right('$(vFieldName)',2) = 'ID' AND Left('$(vFieldName)',6) &amp;lt;&amp;gt; '_Fact_' THEN&lt;BR /&gt;LET vStringStart = Index('$(vFieldName)','_',-1);&lt;BR /&gt;LET vStringEnd = (Len('$(vFieldName)') - 2);&lt;BR /&gt;LET vStringLen = $(vStringEnd) - $(vStringStart);&lt;BR /&gt;LET vThisField = Mid('$(vFieldName)', ($(vStringStart)+1), $(vStringLen));&lt;BR /&gt;LET vThisFactField = '_Fact_' &amp;amp; '$(vThisField)' &amp;amp; 'Key';&lt;BR /&gt;IF '$(vThisFactField)' &amp;lt;&amp;gt; '$(vFactFieldName)' AND ISNULL(TableNumber('$(vThisField)')) = 0 THEN&lt;BR /&gt;LET vLoadString = '$(vLoadString)' &amp;amp; ',' &amp;amp; '$(vFieldName)' &amp;amp; ' AS ' &amp;amp; '$(vThisFactField)' &amp;amp; Chr(13) &amp;amp; Chr(10);&lt;BR /&gt;END IF&lt;BR /&gt;END IF&lt;BR /&gt;NEXT ;&lt;BR /&gt;LET vLoadString = '$(vLoadString)' &amp;amp; ', ' &amp;amp; 'TableName($(vTableNumber))' &amp;amp; ' AS _FactType' &amp;amp; Chr(13) &amp;amp; Chr(10);&lt;BR /&gt;LET vLoadString = '$(vLoadString)' &amp;amp; ',1 AS _FactCounter' &amp;amp; Chr(13) &amp;amp; Chr(10);&lt;BR /&gt;LET vLoadString = '$(vLoadString)' &amp;amp; 'RESIDENT ' &amp;amp; '$(vTableName)' &amp;amp; ';' ;&lt;BR /&gt;$(vLoadString)&lt;BR /&gt;End If&lt;BR /&gt;NEXT ;&lt;/P&gt;&lt;P&gt;Thank you in advance for your help. If this is not a post that is acceptable, please let me know before marking as spam.&lt;/P&gt;&lt;P&gt;Image of the syntax error:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="loadscriptError.PNG" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/37047i920D18AD8491D70B/image-size/large?v=v2&amp;amp;px=999" role="button" title="loadscriptError.PNG" alt="loadscriptError.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Apr 2021 08:31:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/syntax-error-in-my-load-script/m-p/1725545#M63972</guid>
      <dc:creator>darrinturner</dc:creator>
      <dc:date>2021-04-02T08:31:48Z</dc:date>
    </item>
    <item>
      <title>Re: syntax error in my load script</title>
      <link>https://community.qlik.com/t5/App-Development/syntax-error-in-my-load-script/m-p/1725568#M63973</link>
      <description>&lt;P&gt;You didn't show the error message here. It looks like the LOAD statement is dynamically created in the variable&amp;nbsp;&lt;SPAN&gt;vLoadString. You have to check if there is any syntax error.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jul 2020 03:13:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/syntax-error-in-my-load-script/m-p/1725568#M63973</guid>
      <dc:creator>Saravanan_Desingh</dc:creator>
      <dc:date>2020-07-07T03:13:25Z</dc:date>
    </item>
    <item>
      <title>Re: syntax error in my load script</title>
      <link>https://community.qlik.com/t5/App-Development/syntax-error-in-my-load-script/m-p/1726187#M63974</link>
      <description>&lt;P&gt;Just trace your variable $(vLoadString) by ignoring the load-error in the document-log or in a textbox. Copy &amp;amp; paste it then into another application to see if the syntax-highlighting shows something obvious and if not run the script (maybe partial by commenting this and that). It shouldn't be too difficult to find the reason with it.&lt;/P&gt;&lt;P&gt;Beside this I noticed that there are no quotes or brackets for field/table-names with spaces or special-chars, like:&lt;/P&gt;&lt;P&gt;"Field 1" or [XX+YY]&lt;/P&gt;&lt;P&gt;If your fields/tables contain these spaces / special chars you need to add them with your logic.&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jul 2020 16:07:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/syntax-error-in-my-load-script/m-p/1726187#M63974</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2020-07-08T16:07:54Z</dc:date>
    </item>
    <item>
      <title>Re: syntax error in my load script</title>
      <link>https://community.qlik.com/t5/App-Development/syntax-error-in-my-load-script/m-p/1726217#M63975</link>
      <description>&lt;P&gt;Thank you for the reply.&lt;/P&gt;&lt;P&gt;I copied the $(vLoadString) and it looks like:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;Concatenate&lt;/FONT&gt; (&lt;FONT color="#800080"&gt;AssociationTable&lt;/FONT&gt;)&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;Load Distinct&lt;/FONT&gt; &lt;FONT color="#FF6600"&gt;_Fact_OrganUnitsKey&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;,&lt;FONT color="#FF6600"&gt;_OrganUnits_CalendarID&lt;/FONT&gt; &lt;FONT color="#0000FF"&gt;AS&lt;/FONT&gt; &lt;FONT color="#FF6600"&gt;_Fact_CalendarKey&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;,&lt;FONT color="#0000FF"&gt;TableName&lt;/FONT&gt;(0) &lt;FONT color="#0000FF"&gt;AS&lt;/FONT&gt; &lt;FONT color="#FF6600"&gt;_FactType&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;,1 &lt;FONT color="#0000FF"&gt;AS&lt;/FONT&gt; &lt;FONT color="#FF6600"&gt;_FactCounter&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;Resident&lt;/FONT&gt; &lt;FONT color="#800080"&gt;OrganUnits&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Which looks good. My only concern is the &lt;FONT color="#0000FF"&gt;TableName&lt;/FONT&gt;(0). When I look in Resident AssociationTable I see the expected table installed.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;So I did the next step and that was commenting out code until the red exclamation point went away. What I found is when I commented out the&amp;nbsp;$(vLoadString)&amp;nbsp; the red exclamation point did exactly that. I am stumped on this one. In Qlik View, I have this code stored in a xml file and I just call that file. It works perfectly there.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jul 2020 17:41:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/syntax-error-in-my-load-script/m-p/1726217#M63975</guid>
      <dc:creator>darrinturner</dc:creator>
      <dc:date>2020-07-08T17:41:20Z</dc:date>
    </item>
    <item>
      <title>Re: syntax error in my load script</title>
      <link>https://community.qlik.com/t5/App-Development/syntax-error-in-my-load-script/m-p/1726361#M63976</link>
      <description>&lt;P&gt;You mean the same load-on-the-fly routine and/or this single load-statement worked in QlikView and not in Sense?&lt;/P&gt;&lt;P&gt;What do you mean with you stored it within a xml and called it then? Really xml or a flat-file which is called as include-variable?&lt;/P&gt;&lt;P&gt;Beside this the display of an error doesn't mandatory mean that there is really an error. The syntax-checker is a good tool to detect mistakes but it's not without failures - and such variables won't be parsed from it and therefore it shows often an error.&lt;/P&gt;&lt;P&gt;Further happens the error in each iteration of your loop or only by certain ones?&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jul 2020 07:59:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/syntax-error-in-my-load-script/m-p/1726361#M63976</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2020-07-09T07:59:29Z</dc:date>
    </item>
    <item>
      <title>Re: syntax error in my load script</title>
      <link>https://community.qlik.com/t5/App-Development/syntax-error-in-my-load-script/m-p/1726493#M63977</link>
      <description>&lt;P&gt;Great questions.&lt;/P&gt;&lt;P&gt;The way I am using the code is different between QV and QS. In QV, yes it is in a flat file which I call using the include statements. In QS, I have this code written directly in the data load editor. Forget I mentioned xml, I had another project in my head when I was writing. That project does basically the same thing, but it gets it's tables from and xml file.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, I am not going to call this an error again. I am agreeing with your statement "&lt;SPAN&gt;&amp;nbsp;The syntax-checker is a good tool to detect mistakes but it's not without failures - and such variables won't be parsed from it and therefore it shows often an error"&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The code does exactly as needed, however I have developers that always point out the red exclamation&amp;nbsp;point!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you for your responses.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jul 2020 12:39:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/syntax-error-in-my-load-script/m-p/1726493#M63977</guid>
      <dc:creator>darrinturner</dc:creator>
      <dc:date>2020-07-09T12:39:33Z</dc:date>
    </item>
  </channel>
</rss>

