<?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 a variable field in the load script? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Creating-a-variable-field-in-the-load-script/m-p/436205#M1157940</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi tylerjameswilson,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it seems to me that you better create a new field during the load. A variable can have a lot different values during loadtime but only one "endvalue" when the load is done. So my suggestions is using a preceding load to create an additional field "MyColor" similar to:&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; Market, Region, Batman . . . and the rest,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if( Len(Trim(Batman)) = 0 and Region = 'Gotham', 'Red',&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // isnull(Batman) and . ..&amp;nbsp; should work also&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if( Len(Trim(Batman)) = 0 and Region = 'London', 'Yellow',&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if( Len(Trim(Batman)) = 0 and Region = 'Paris', 'green', &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'unkown'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )))&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AS MyColor&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;SQL Select Market . .. and the rest&lt;/P&gt;&lt;P&gt;From Table;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now MyColor can be used everywhere (Listboxes etc.) in the whole app.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HtH&lt;/P&gt;&lt;P&gt;Roland&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 16 Dec 2012 16:24:37 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-12-16T16:24:37Z</dc:date>
    <item>
      <title>Creating a variable field in the load script?</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-a-variable-field-in-the-load-script/m-p/436204#M1157939</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello. I am trying to create a variable for the document that I can use all over, that checks several conditions within the fields I'm pulling in from a database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let's call the variable a color for example, vColor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SQL Select Market,&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Region,&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Batman, etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vColor can equal Red, Green, or Yellow.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vColor is Red if the field Batman is Null and the field Region is Gotham.&lt;/P&gt;&lt;P&gt;vColor is Yellow if the field Batman is Null and the field Region is London.&lt;/P&gt;&lt;P&gt;vColor is Green if.....etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And of course I would like to use this variable field in my sheet objects.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm assuming I need to do this in the load statement, right? I don't understand how to give a variable three possible values and assign them according to outside values.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Dec 2012 17:53:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-a-variable-field-in-the-load-script/m-p/436204#M1157939</guid>
      <dc:creator />
      <dc:date>2012-12-13T17:53:05Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a variable field in the load script?</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-a-variable-field-in-the-load-script/m-p/436205#M1157940</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi tylerjameswilson,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it seems to me that you better create a new field during the load. A variable can have a lot different values during loadtime but only one "endvalue" when the load is done. So my suggestions is using a preceding load to create an additional field "MyColor" similar to:&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; Market, Region, Batman . . . and the rest,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if( Len(Trim(Batman)) = 0 and Region = 'Gotham', 'Red',&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // isnull(Batman) and . ..&amp;nbsp; should work also&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if( Len(Trim(Batman)) = 0 and Region = 'London', 'Yellow',&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if( Len(Trim(Batman)) = 0 and Region = 'Paris', 'green', &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'unkown'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )))&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AS MyColor&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;SQL Select Market . .. and the rest&lt;/P&gt;&lt;P&gt;From Table;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now MyColor can be used everywhere (Listboxes etc.) in the whole app.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HtH&lt;/P&gt;&lt;P&gt;Roland&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 16 Dec 2012 16:24:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-a-variable-field-in-the-load-script/m-p/436205#M1157940</guid>
      <dc:creator />
      <dc:date>2012-12-16T16:24:37Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a variable field in the load script?</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-a-variable-field-in-the-load-script/m-p/436206#M1157941</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Roland. I think I was asking my question poorly but you figured it out. Works great, thanks again!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Dec 2012 13:22:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-a-variable-field-in-the-load-script/m-p/436206#M1157941</guid>
      <dc:creator />
      <dc:date>2012-12-17T13:22:18Z</dc:date>
    </item>
  </channel>
</rss>

