<?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 Dealing with apostrophe in load statement in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Dealing-with-apostrophe-in-load-statement/m-p/282136#M104893</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a load script running inside a for loop, something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for i=0 to $(noRows)-1 // loop through every row&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; let textRaw = peek('Search_text',$(i),'TwitterConnector_Search'); // get the value for "text" field on each row&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Table1:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '$(textRaw)' as Search_text,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; status as sentiment_status,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM //.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;next&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is that some of the values contain apostrophes, meaning the expanded script (when viewed in the log file) ends up looking something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;'''text with apostrophe in' as Search_text,&lt;/P&gt;&lt;P&gt;status as sentiment_status&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;// ....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Resulting in a:&lt;/P&gt;&lt;P&gt;Syntax error, missing/misplaced FROM:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any way I can deal with this and load the textRaw into Table1 with apostrophes intact?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 18 Aug 2011 10:25:18 GMT</pubDate>
    <dc:creator>chrisbrain</dc:creator>
    <dc:date>2011-08-18T10:25:18Z</dc:date>
    <item>
      <title>Dealing with apostrophe in load statement</title>
      <link>https://community.qlik.com/t5/QlikView/Dealing-with-apostrophe-in-load-statement/m-p/282136#M104893</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a load script running inside a for loop, something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for i=0 to $(noRows)-1 // loop through every row&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; let textRaw = peek('Search_text',$(i),'TwitterConnector_Search'); // get the value for "text" field on each row&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Table1:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '$(textRaw)' as Search_text,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; status as sentiment_status,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM //.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;next&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is that some of the values contain apostrophes, meaning the expanded script (when viewed in the log file) ends up looking something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;'''text with apostrophe in' as Search_text,&lt;/P&gt;&lt;P&gt;status as sentiment_status&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;// ....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Resulting in a:&lt;/P&gt;&lt;P&gt;Syntax error, missing/misplaced FROM:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any way I can deal with this and load the textRaw into Table1 with apostrophes intact?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Aug 2011 10:25:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dealing-with-apostrophe-in-load-statement/m-p/282136#M104893</guid>
      <dc:creator>chrisbrain</dc:creator>
      <dc:date>2011-08-18T10:25:18Z</dc:date>
    </item>
    <item>
      <title>Dealing with apostrophe in load statement</title>
      <link>https://community.qlik.com/t5/QlikView/Dealing-with-apostrophe-in-load-statement/m-p/282137#M104894</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Chris,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This may well fall in to the 'Cowboy Workaround' catergory but it could work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Replace the apostrophes (chr(39)) with another non-used but standard character - for instance '^' (chr(94)) before the load so as to stop them causing problems before reversing the process after the load by replacing chr(94) with chr(39) to re-instate your apostrophes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As I said "Yeee-Haaw".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps a little,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Matt - Visual Analytics Ltd&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Aug 2011 11:00:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dealing-with-apostrophe-in-load-statement/m-p/282137#M104894</guid>
      <dc:creator>matt_crowther</dc:creator>
      <dc:date>2011-08-18T11:00:11Z</dc:date>
    </item>
    <item>
      <title>Dealing with apostrophe in load statement</title>
      <link>https://community.qlik.com/t5/QlikView/Dealing-with-apostrophe-in-load-statement/m-p/282138#M104895</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Haha thanks - but wouldn't this mean I didn't have the correct text in my Table1? &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/confused.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have actually done a work around now to use a separate id parameter to link the table to the rest of the schema, so it's now something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; let textRaw = peek('Search_text',$(i),'TwitterConnector_Search'); // get the value for "text" field on each row&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; let id = peek('Search_text',$(i),'TwitterConnector_id');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Table1:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '$(id)' as Search_id,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; status as sentiment_status,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM //..... Note textRaw is url encoded and used in load request here which is why we need it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;next&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It would have been better if I could link on the text but I think this is a safer solution!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Aug 2011 06:58:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dealing-with-apostrophe-in-load-statement/m-p/282138#M104895</guid>
      <dc:creator>chrisbrain</dc:creator>
      <dc:date>2011-08-19T06:58:45Z</dc:date>
    </item>
    <item>
      <title>Dealing with apostrophe in load statement</title>
      <link>https://community.qlik.com/t5/QlikView/Dealing-with-apostrophe-in-load-statement/m-p/282139#M104896</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Chris,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am curious because I also have encountered similar problems.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't really understand your solution, for id, you query a field also named Search_text, but from a different table, right? Does this gives you an id, then?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One more idea:&lt;/P&gt;&lt;P&gt;Why do you think a text based link would be better? I would guess from a performance side, a numerical should be probably better. If you doubt that your id is as unique as your search text, you may create a separate hash value using e.g. hash256() function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Aug 2011 09:25:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dealing-with-apostrophe-in-load-statement/m-p/282139#M104896</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-08-19T09:25:04Z</dc:date>
    </item>
  </channel>
</rss>

