<?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: Creating variables in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Creating-variables/m-p/362611#M704184</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jose,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;I may require to use variable created in Employee table in the creation of other variables. &lt;/P&gt;&lt;P&gt;So, if I go with your logic then I may have to create separate tables for each variables..correct me if am wrong.&lt;/P&gt;&lt;P&gt;what does * do in your code? Does it load all the columns from Employee_Temp?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have to achieve following output with following coloumns&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EmpNo&amp;nbsp; Name&amp;nbsp;&amp;nbsp; Department&amp;nbsp; Mapping&amp;nbsp;&amp;nbsp;&amp;nbsp; Var1&amp;nbsp;&amp;nbsp;&amp;nbsp; Var2&amp;nbsp;&amp;nbsp; Var3&amp;nbsp;&amp;nbsp; Var4&amp;nbsp; Var5&amp;nbsp;&amp;nbsp; Var6&amp;nbsp; Var7&amp;nbsp; Var8&amp;nbsp; Var9&amp;nbsp;&amp;nbsp; Var10&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Var2 needs to be created using Var1 and Department coloumn&lt;/P&gt;&lt;P&gt;Var3, Var4, Var5 --- same as var2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Var6 needs to be created using other Mapping table and the main employee table.&lt;/P&gt;&lt;P&gt;Var7.....Same as Var6&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In My code Part 2 is nothing but the inclusion of Mapping Table, I have 6 same kind of Mapping tables..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In Part 3 of my code, Pls replace sheet1 with Employee table and sheet2 with Mapping table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help me with the best approach to achieve this requirement as well as the what kind of performance tunning steps we need to keep in mind while writing the code.&lt;/P&gt;&lt;P&gt;To get the data in cronological order for variables, Do we have to always use the Left Join for creation of variable?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;ss&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 22 Jun 2012 05:31:27 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-06-22T05:31:27Z</dc:date>
    <item>
      <title>Creating variables</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-variables/m-p/362609#M704182</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have loaded the data in qlik view from multiple excel sheets,one sheet has 25000 rows&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;code:&lt;/P&gt;&lt;P&gt;//part1&lt;/P&gt;&lt;P&gt;Employee:&lt;/P&gt;&lt;P&gt;load&lt;/P&gt;&lt;P&gt;EmpNo,&lt;/P&gt;&lt;P&gt;Name&lt;/P&gt;&lt;P&gt;Department&lt;/P&gt;&lt;P&gt;from Sheet1;&lt;/P&gt;&lt;P&gt;//part 2&lt;/P&gt;&lt;P&gt;Mapping:&lt;/P&gt;&lt;P&gt;load&lt;/P&gt;&lt;P&gt;EmpNo,&lt;/P&gt;&lt;P&gt;[Mapping]&lt;/P&gt;&lt;P&gt;from Sheet2;&lt;/P&gt;&lt;P&gt;part 3&lt;/P&gt;&lt;P&gt;left join (Sheet1)&lt;/P&gt;&lt;P&gt;load&lt;/P&gt;&lt;P&gt;EmpNo,&lt;/P&gt;&lt;P&gt;[Mapping]&lt;/P&gt;&lt;P&gt;if(isnull([Mapping]), 'Home',[Mapping]) as Map1&lt;/P&gt;&lt;P&gt;resident sheet2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;drop tables Mapping;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;part4&lt;/P&gt;&lt;P&gt;left join(Employee)&lt;/P&gt;&lt;P&gt;load&lt;/P&gt;&lt;P&gt;EmpNo,&lt;/P&gt;&lt;P&gt;if(Map1 = 'XYZ' and Name = 'ABC', 'PQR',Map1) as Map2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;resident Employee;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this query dosen't bring the data and this problem observed after adding part 4 in the code, I have to add atleast 15 such variables in the code.&lt;/P&gt;&lt;P&gt;please suggest the solution&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am new to coding, pls share if anyone has any docs on coding as well as best practices for coding.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;ss&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jun 2012 11:25:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-variables/m-p/362609#M704182</guid>
      <dc:creator />
      <dc:date>2012-06-21T11:25:43Z</dc:date>
    </item>
    <item>
      <title>Re: Creating variables</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-variables/m-p/362610#M704183</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First of all, I recommend you to rename Employee table to Employee_temp because in part4 you are going to create the table Employee with data of Employee_temp adding the last field:&lt;/P&gt;&lt;P&gt; &lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #eef4f9;"&gt;if(Map1 = 'XYZ' and Name = 'ABC', 'PQR',Map1) as Map2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #eef4f9;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I think that you have to do this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;//part4&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;EMPLOYEE:&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;load&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;*,&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;if(Map1 = 'XYZ' and Name = 'ABC', 'PQR',Map1) as Map2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;resident Employee_temp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You should use the wizard to bring data from your sheets, in the script section, the button below that is Files .... or something like that, I´m using the spanish version and is Ficheros Planos...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jun 2012 13:33:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-variables/m-p/362610#M704183</guid>
      <dc:creator>chematos</dc:creator>
      <dc:date>2012-06-21T13:33:49Z</dc:date>
    </item>
    <item>
      <title>Re: Creating variables</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-variables/m-p/362611#M704184</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jose,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;I may require to use variable created in Employee table in the creation of other variables. &lt;/P&gt;&lt;P&gt;So, if I go with your logic then I may have to create separate tables for each variables..correct me if am wrong.&lt;/P&gt;&lt;P&gt;what does * do in your code? Does it load all the columns from Employee_Temp?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have to achieve following output with following coloumns&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EmpNo&amp;nbsp; Name&amp;nbsp;&amp;nbsp; Department&amp;nbsp; Mapping&amp;nbsp;&amp;nbsp;&amp;nbsp; Var1&amp;nbsp;&amp;nbsp;&amp;nbsp; Var2&amp;nbsp;&amp;nbsp; Var3&amp;nbsp;&amp;nbsp; Var4&amp;nbsp; Var5&amp;nbsp;&amp;nbsp; Var6&amp;nbsp; Var7&amp;nbsp; Var8&amp;nbsp; Var9&amp;nbsp;&amp;nbsp; Var10&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Var2 needs to be created using Var1 and Department coloumn&lt;/P&gt;&lt;P&gt;Var3, Var4, Var5 --- same as var2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Var6 needs to be created using other Mapping table and the main employee table.&lt;/P&gt;&lt;P&gt;Var7.....Same as Var6&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In My code Part 2 is nothing but the inclusion of Mapping Table, I have 6 same kind of Mapping tables..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In Part 3 of my code, Pls replace sheet1 with Employee table and sheet2 with Mapping table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help me with the best approach to achieve this requirement as well as the what kind of performance tunning steps we need to keep in mind while writing the code.&lt;/P&gt;&lt;P&gt;To get the data in cronological order for variables, Do we have to always use the Left Join for creation of variable?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;ss&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jun 2012 05:31:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-variables/m-p/362611#M704184</guid>
      <dc:creator />
      <dc:date>2012-06-22T05:31:27Z</dc:date>
    </item>
    <item>
      <title>Re: Creating variables</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-variables/m-p/362612#M704185</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Yes, * is to load all the fields from the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I´ve understood well, may be there is a simple solution although I have not tried yet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is a way to use fields that they are not created yet that its called load preceding so you can calculate fields and use them in the same load without making another table and a left join, it´s better if I write an exmaple:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EMPLOYEE:&lt;/P&gt;&lt;P&gt;LOAD *,&lt;/P&gt;&lt;P&gt;If(Map2 = 'XXX' and Department = 'YYY', 'NEW_VALUE',Map2) as Map3,&lt;/P&gt;&lt;P&gt;if(Map3 = ..........................................................................) as Map4,&lt;/P&gt;&lt;P&gt;if(Map4 = ..........................................................................) as Map5,&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;load&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;*,&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;if(Map1 = 'XYZ' and Name = 'ABC', 'PQR',Map1) as Map2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;resident Employee_temp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That is the syntax, the first load is executed after the second Load sentece, that´s why you can use the field Map2 in the first Load sentence.&lt;/P&gt;&lt;P&gt;I've used that many times but never with this particular case, so try it and tell me if it works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jun 2012 14:28:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-variables/m-p/362612#M704185</guid>
      <dc:creator>chematos</dc:creator>
      <dc:date>2012-06-22T14:28:59Z</dc:date>
    </item>
    <item>
      <title>Re: Creating variables</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-variables/m-p/362613#M704186</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanx alot for your reply..i will test it and will update u.&lt;/P&gt;&lt;P&gt;As i mentioned in my second post that some of variables are comming from different mapping tables.&lt;/P&gt;&lt;P&gt;Currently i am loading all mapping tables and then creating variable and applying left join to get the variable in main table..&lt;/P&gt;&lt;P&gt;I think i am doing wrong...&lt;/P&gt;&lt;P&gt;Pls suggest me the suitable way to achieve this..&lt;/P&gt;&lt;P&gt;Pls tell me do we have to follow data modelling (star schema)while coding&lt;/P&gt;&lt;P&gt;If yes pls tell me how can i achive this in my scenario..&lt;/P&gt;&lt;P&gt;also while writing code i always try to bring all the variables and colums of mapping tables in the main table...&lt;/P&gt;&lt;P&gt;My understanding is that when we apply left join between main table and the mapping tables then obly i will get the data in expected order.&lt;/P&gt;&lt;P&gt;Does it right way to do the coding?&lt;/P&gt;&lt;P&gt;Thank &lt;/P&gt;&lt;P&gt;ss&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jun 2012 15:43:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-variables/m-p/362613#M704186</guid>
      <dc:creator />
      <dc:date>2012-06-22T15:43:37Z</dc:date>
    </item>
    <item>
      <title>Re: Creating variables</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-variables/m-p/362614#M704187</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I cant see this right now, but I assumed that you knew about applymap() function and mapping tables.&lt;/P&gt;&lt;P&gt;Are you using all of this?? If you don´t, you should start reading about applymap function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, I will take a look of that &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jun 2012 15:50:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-variables/m-p/362614#M704187</guid>
      <dc:creator>chematos</dc:creator>
      <dc:date>2012-06-22T15:50:58Z</dc:date>
    </item>
    <item>
      <title>Re: Creating variables</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-variables/m-p/362615#M704188</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi there,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am with basic knowledge of qlikview, but less with coding part, so want to know how to cope up with this qlikview.&lt;/P&gt;&lt;P&gt;And also want to know that how to be a good developer in qlikview&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 13 Oct 2012 15:27:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-variables/m-p/362615#M704188</guid>
      <dc:creator />
      <dc:date>2012-10-13T15:27:42Z</dc:date>
    </item>
    <item>
      <title>Re: Creating variables</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-variables/m-p/362616#M704189</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi ss,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; why you are creating someny variables in scripting,if you create a flag based on your condition in if statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can yoou provide test data i will show you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 13 Oct 2012 17:16:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-variables/m-p/362616#M704189</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-10-13T17:16:47Z</dc:date>
    </item>
    <item>
      <title>Re: Creating variables</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-variables/m-p/362617#M704190</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;my question is , as I am new to qlikview and not having enough coding skills, how can I go ahead as qlikview developer to do better &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 13 Oct 2012 17:22:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-variables/m-p/362617#M704190</guid>
      <dc:creator />
      <dc:date>2012-10-13T17:22:04Z</dc:date>
    </item>
  </channel>
</rss>

