<?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 Load script: Create a new variabele (with a statement) in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Load-script-Create-a-new-variabele-with-a-statement/m-p/288755#M107337</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the following issue:&lt;/P&gt;&lt;P&gt;- I have created several TABS in the 'Edit Script' and have loaded several tables frmo my SQL server. &lt;/P&gt;&lt;P&gt;Tabs:Invoice, Shipment, Journal&lt;/P&gt;&lt;P&gt;Tables: InvoiceHeader, InvoiceLines, ShipmentHeader, Journal&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I created a new TAB named 'Tests' where I want to create a new table (Tests) where I want to make a new variable based on the several variabeles I created the other tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tests:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if([J_Country_Region Code]=[S_Ship-to Country_Region Code],if([Country Code]='BE','Test OK','Country of Stock Error'),if([Country Code]='BE','Test&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OK','Shipping Country Error')) AS 'Test 5A';&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I reload my script, it does not create this table or the variable 'Test 5A' I would like to use in my table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What should I do to make this work or should I create this variable in SQL on my server?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sidenote: &lt;/P&gt;&lt;P&gt;- I use the renamed variables in this statement from the other tables. I must do this because several variables have the same neam ein the different tables&lt;/P&gt;&lt;P&gt;- I cannot use an expression in qlikview itself to do this because I want to create a pie chart and when I then click on the chart results it looks at the dimensions used in the expression instead of simply looking at the dimension itself.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 08 Dec 2011 15:33:37 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-12-08T15:33:37Z</dc:date>
    <item>
      <title>Load script: Create a new variabele (with a statement)</title>
      <link>https://community.qlik.com/t5/QlikView/Load-script-Create-a-new-variabele-with-a-statement/m-p/288755#M107337</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the following issue:&lt;/P&gt;&lt;P&gt;- I have created several TABS in the 'Edit Script' and have loaded several tables frmo my SQL server. &lt;/P&gt;&lt;P&gt;Tabs:Invoice, Shipment, Journal&lt;/P&gt;&lt;P&gt;Tables: InvoiceHeader, InvoiceLines, ShipmentHeader, Journal&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I created a new TAB named 'Tests' where I want to create a new table (Tests) where I want to make a new variable based on the several variabeles I created the other tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tests:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if([J_Country_Region Code]=[S_Ship-to Country_Region Code],if([Country Code]='BE','Test OK','Country of Stock Error'),if([Country Code]='BE','Test&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OK','Shipping Country Error')) AS 'Test 5A';&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I reload my script, it does not create this table or the variable 'Test 5A' I would like to use in my table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What should I do to make this work or should I create this variable in SQL on my server?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sidenote: &lt;/P&gt;&lt;P&gt;- I use the renamed variables in this statement from the other tables. I must do this because several variables have the same neam ein the different tables&lt;/P&gt;&lt;P&gt;- I cannot use an expression in qlikview itself to do this because I want to create a pie chart and when I then click on the chart results it looks at the dimensions used in the expression instead of simply looking at the dimension itself.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Dec 2011 15:33:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-script-Create-a-new-variabele-with-a-statement/m-p/288755#M107337</guid>
      <dc:creator />
      <dc:date>2011-12-08T15:33:37Z</dc:date>
    </item>
    <item>
      <title>Load script: Create a new variabele (with a statement)</title>
      <link>https://community.qlik.com/t5/QlikView/Load-script-Create-a-new-variabele-with-a-statement/m-p/288756#M107338</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;Use let to create and initialize a variable like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET &lt;EM&gt;Test5A = &lt;/EM&gt;&lt;EM&gt;Your if condition;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;When I checked you If condition it has more parameters.&amp;nbsp; If has only 3 parameters, Expression, True value and False value.&amp;nbsp; But your expression has 4 values.&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Regards,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Jagan.&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Dec 2011 06:27:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-script-Create-a-new-variabele-with-a-statement/m-p/288756#M107338</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2011-12-09T06:27:49Z</dc:date>
    </item>
    <item>
      <title>Re: Load script: Create a new variabele (with a statement)</title>
      <link>https://community.qlik.com/t5/QlikView/Load-script-Create-a-new-variabele-with-a-statement/m-p/288757#M107339</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 I'm not clear with your point. Let try this&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;IF ([J_Country_Region Code]=[S_Ship-to Country_Region Code],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (IF [Country Code]='BE','Test Ok','Country of Stock Error'),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (IF [Country Code]='BE','Test OK','Shipping Country Error')&lt;/P&gt;&lt;P&gt;)&amp;nbsp;&amp;nbsp;&amp;nbsp; AS [Test5A];&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;I think this one does not make sense. Because [Country Code]='BE' is use two time with different condition. If you can attached your small application then is make easy to understand what you looking for.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sokkorn Cheav&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Dec 2011 07:59:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-script-Create-a-new-variabele-with-a-statement/m-p/288757#M107339</guid>
      <dc:creator>Sokkorn</dc:creator>
      <dc:date>2011-12-09T07:59:17Z</dc:date>
    </item>
  </channel>
</rss>

