<?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 String variables in script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/String-variables-in-script/m-p/636043#M678788</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I extract data from 5 databases which have excatly the same structure (same tables, same name of columns). Each database contains the data for one city.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to use all these data in one only table. The problem is that, I have in each table, idCustomer=1 whereas it doesn't stand for the same customer...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So what I've done so far is that I've created a new column 'City' when I import the data and then I concatenate the first letter of the city in front of every ID. So I have for example, P01, L01 and so on...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These is a piece of code :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;LOAD&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;'Paris'&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff;"&gt;AS&lt;/SPAN&gt; Ville,&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;'P'&lt;/SPAN&gt;&amp;amp;id &lt;SPAN style="color: #0000ff;"&gt;AS&lt;/SPAN&gt; id_client&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;FROM&lt;/SPAN&gt; TableCity&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And I do this for each city...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It has worked so far but the thing is that in the future, there will be more cities... and besides,&amp;nbsp; I dont like the fact that I have to write the 'P' in front of the names of each columns..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to use a variable that contains the 'P' and something like this :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vVille=&lt;SPAN style="color: #ff0000;"&gt;'P'&lt;/SPAN&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;LOAD&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;$&lt;SPAN class="br0"&gt;(&lt;/SPAN&gt;vVille&lt;SPAN class="br0"&gt;)&lt;/SPAN&gt; &amp;amp; id as idClient;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SQL SELECT * FROM TableCity&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But it doesn't work because the string variable doesnt "remember" the ' ' in the LOAD...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you got an idea of how I could do this ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or if you have a more consistent solution to solve my problem, i would also glad to read it ! &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;&lt;/P&gt;&lt;P&gt;Thank you very much and have a good day !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 May 2014 10:28:31 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-05-16T10:28:31Z</dc:date>
    <item>
      <title>String variables in script</title>
      <link>https://community.qlik.com/t5/QlikView/String-variables-in-script/m-p/636043#M678788</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I extract data from 5 databases which have excatly the same structure (same tables, same name of columns). Each database contains the data for one city.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to use all these data in one only table. The problem is that, I have in each table, idCustomer=1 whereas it doesn't stand for the same customer...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So what I've done so far is that I've created a new column 'City' when I import the data and then I concatenate the first letter of the city in front of every ID. So I have for example, P01, L01 and so on...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These is a piece of code :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;LOAD&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;'Paris'&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff;"&gt;AS&lt;/SPAN&gt; Ville,&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;'P'&lt;/SPAN&gt;&amp;amp;id &lt;SPAN style="color: #0000ff;"&gt;AS&lt;/SPAN&gt; id_client&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;FROM&lt;/SPAN&gt; TableCity&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And I do this for each city...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It has worked so far but the thing is that in the future, there will be more cities... and besides,&amp;nbsp; I dont like the fact that I have to write the 'P' in front of the names of each columns..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to use a variable that contains the 'P' and something like this :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vVille=&lt;SPAN style="color: #ff0000;"&gt;'P'&lt;/SPAN&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;LOAD&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;$&lt;SPAN class="br0"&gt;(&lt;/SPAN&gt;vVille&lt;SPAN class="br0"&gt;)&lt;/SPAN&gt; &amp;amp; id as idClient;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SQL SELECT * FROM TableCity&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But it doesn't work because the string variable doesnt "remember" the ' ' in the LOAD...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you got an idea of how I could do this ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or if you have a more consistent solution to solve my problem, i would also glad to read it ! &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;&lt;/P&gt;&lt;P&gt;Thank you very much and have a good day !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 May 2014 10:28:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/String-variables-in-script/m-p/636043#M678788</guid>
      <dc:creator />
      <dc:date>2014-05-16T10:28:31Z</dc:date>
    </item>
    <item>
      <title>Re: String variables in script</title>
      <link>https://community.qlik.com/t5/QlikView/String-variables-in-script/m-p/636044#M678789</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why not use the qualify statement ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 May 2014 10:56:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/String-variables-in-script/m-p/636044#M678789</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-05-16T10:56:36Z</dc:date>
    </item>
    <item>
      <title>Re: String variables in script</title>
      <link>https://community.qlik.com/t5/QlikView/String-variables-in-script/m-p/636045#M678790</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;and if you Chr(39) instead of&amp;nbsp; the apostrophe.&lt;/P&gt;&lt;P&gt;then the script will interpret it&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 May 2014 10:58:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/String-variables-in-script/m-p/636045#M678790</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-05-16T10:58:06Z</dc:date>
    </item>
    <item>
      <title>Re: String variables in script</title>
      <link>https://community.qlik.com/t5/QlikView/String-variables-in-script/m-p/636046#M678791</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you eruditio, actually the example was wrong because all the tables have the same name.. I've corrected ot.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 May 2014 11:00:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/String-variables-in-script/m-p/636046#M678791</guid>
      <dc:creator />
      <dc:date>2014-05-16T11:00:00Z</dc:date>
    </item>
    <item>
      <title>Re: String variables in script</title>
      <link>https://community.qlik.com/t5/QlikView/String-variables-in-script/m-p/636047#M678792</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;another way is '$&lt;SPAN class="br0"&gt;(&lt;/SPAN&gt;vVille&lt;SPAN class="br0"&gt;)'&lt;/SPAN&gt; &amp;amp; id as idClient;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 May 2014 11:02:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/String-variables-in-script/m-p/636047#M678792</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-05-16T11:02:58Z</dc:date>
    </item>
    <item>
      <title>Re: String variables in script</title>
      <link>https://community.qlik.com/t5/QlikView/String-variables-in-script/m-p/636048#M678793</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, I will try it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But what is the syntax ? Where do I put the Chr(39) ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vVille=' P';&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>Fri, 16 May 2014 11:03:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/String-variables-in-script/m-p/636048#M678793</guid>
      <dc:creator />
      <dc:date>2014-05-16T11:03:53Z</dc:date>
    </item>
    <item>
      <title>Re: String variables in script</title>
      <link>https://community.qlik.com/t5/QlikView/String-variables-in-script/m-p/636049#M678794</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Add quotes around $() in Load as below&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #0000ff;"&gt;LOAD&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="color: #ff0000; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;'&lt;/SPAN&gt;$&lt;SPAN class="br0" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;(&lt;/SPAN&gt;vVille&lt;SPAN class="br0" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;)&lt;SPAN style="color: #ff0000; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;'&lt;/SPAN&gt;&lt;/SPAN&gt; &amp;amp; id as idClient;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 May 2014 11:04:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/String-variables-in-script/m-p/636049#M678794</guid>
      <dc:creator>anbu1984</dc:creator>
      <dc:date>2014-05-16T11:04:35Z</dc:date>
    </item>
    <item>
      <title>Re: String variables in script</title>
      <link>https://community.qlik.com/t5/QlikView/String-variables-in-script/m-p/636050#M678795</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;Remember that a variable expansion using $() is applied before the statement is interpreted. So just use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-style: inherit; font-family: inherit; color: #0000ff;"&gt;LOAD &lt;/SPAN&gt;'$&lt;SPAN class="br0" style="font-style: inherit; font-family: inherit;"&gt;(&lt;/SPAN&gt;vVille&lt;SPAN class="br0" style="font-style: inherit; font-family: inherit;"&gt;)'&lt;/SPAN&gt; &amp;amp; id as idClient;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;The quotes in the Set statement are assumed to be delimiters and are not included in the string. &lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;HTH&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 May 2014 11:04:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/String-variables-in-script/m-p/636050#M678795</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2014-05-16T11:04:52Z</dc:date>
    </item>
    <item>
      <title>Re: String variables in script</title>
      <link>https://community.qlik.com/t5/QlikView/String-variables-in-script/m-p/636051#M678796</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;First option: Hardcode to your origin data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD *&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Origin1' &amp;amp; yourID&amp;nbsp; as OriginID&lt;/P&gt;&lt;P&gt;from ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Second option: A variable with your origin data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vOrigin = 'Origin1'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD *&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $v(Origin) &amp;amp; yourID&amp;nbsp; as OriginID&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;Hope it helps you &lt;/P&gt;&lt;P&gt;Joaquín&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 May 2014 11:06:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/String-variables-in-script/m-p/636051#M678796</guid>
      <dc:creator>Joaquin_Lazaro</dc:creator>
      <dc:date>2014-05-16T11:06:00Z</dc:date>
    </item>
    <item>
      <title>Re: String variables in script</title>
      <link>https://community.qlik.com/t5/QlikView/String-variables-in-script/m-p/636052#M678797</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you everyone ! &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/wink.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a good day &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 May 2014 11:07:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/String-variables-in-script/m-p/636052#M678797</guid>
      <dc:creator />
      <dc:date>2014-05-16T11:07:50Z</dc:date>
    </item>
  </channel>
</rss>

