<?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: Is it possible to set a field into a variable in the load script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Is-it-possible-to-set-a-field-into-a-variable-in-the-load-script/m-p/1139094#M373557</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've just loaded inline to duplicate the scenario of your fact table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You should Load your FACT tables as usual , what you really need is the table with distinct division values&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f2f2f2;"&gt;DivisionsList:&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f2f2f2;"&gt;LOAD Distinct Division as DivisionIS&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f2f2f2;"&gt;RESIDENT FACT;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f2f2f2;"&gt;let DivisionCount = NoOfRows('DivisionsList')-1;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f2f2f2;"&gt;LET varDivision = '';&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f2f2f2;"&gt;For i = 0 to $(DivisionCount)&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f2f2f2;"&gt;LET varDivision = varDivision &amp;amp; if($(i)&amp;gt;=1,chr(59)) &amp;amp; Peek('DivisionIS',$(i),'DivisionsList');&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f2f2f2;"&gt;Next i&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Steps&lt;/STRONG&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;LOAD FACT&lt;/LI&gt;&lt;LI&gt;Load a Table to hold distinct values, that you need to store in variable&lt;/LI&gt;&lt;LI&gt;loop over the distinct values and add to variable&lt;/LI&gt;&lt;/OL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 19 Aug 2016 09:31:50 GMT</pubDate>
    <dc:creator>vinieme12</dc:creator>
    <dc:date>2016-08-19T09:31:50Z</dc:date>
    <item>
      <title>Is it possible to set a field into a variable in the load script</title>
      <link>https://community.qlik.com/t5/QlikView/Is-it-possible-to-set-a-field-into-a-variable-in-the-load-script/m-p/1139089#M373552</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Qlikview user&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it possible to set the field of another table into a variable in the load script?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If so, could someone kindly show me the correct code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards&lt;/P&gt;&lt;P&gt;Helen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Aug 2016 08:58:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Is-it-possible-to-set-a-field-into-a-variable-in-the-load-script/m-p/1139089#M373552</guid>
      <dc:creator>helen_pip</dc:creator>
      <dc:date>2016-08-19T08:58:12Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to set a field into a variable in the load script</title>
      <link>https://community.qlik.com/t5/QlikView/Is-it-possible-to-set-a-field-into-a-variable-in-the-load-script/m-p/1139090#M373553</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you post sample data and variable output required??&lt;/P&gt;&lt;P&gt;It's easier to visualize what you want to achieve &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Aug 2016 09:00:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Is-it-possible-to-set-a-field-into-a-variable-in-the-load-script/m-p/1139090#M373553</guid>
      <dc:creator>vinieme12</dc:creator>
      <dc:date>2016-08-19T09:00:29Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to set a field into a variable in the load script</title>
      <link>https://community.qlik.com/t5/QlikView/Is-it-possible-to-set-a-field-into-a-variable-in-the-load-script/m-p/1139091#M373554</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Vineeth&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a filed called Division and the values within the Division are&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Division A&lt;/P&gt;&lt;P&gt;Division B&lt;/P&gt;&lt;P&gt;Division C&lt;/P&gt;&lt;P&gt;Division D&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I created a variable in the variable overview and as the field had already been loaded it was easy to create the variable&lt;/P&gt;&lt;P&gt;I.e. v_Div = Division&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I then use the variables as a dimension in a drill down table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However for other purposes I now need to set the variable in the load script where the variable is holding the field name exactly as before, but as the variable and field name are both being loaded into the script, I am unsure how to set the variable in the script&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards&lt;/P&gt;&lt;P&gt;Helen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Aug 2016 09:05:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Is-it-possible-to-set-a-field-into-a-variable-in-the-load-script/m-p/1139091#M373554</guid>
      <dc:creator>helen_pip</dc:creator>
      <dc:date>2016-08-19T09:05:14Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to set a field into a variable in the load script</title>
      <link>https://community.qlik.com/t5/QlikView/Is-it-possible-to-set-a-field-into-a-variable-in-the-load-script/m-p/1139092#M373555</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try below&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;variable Output = Division A;Division B;Division C;Division D&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FACT:&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;Division,Value&lt;/P&gt;&lt;P&gt;Division A,1&lt;/P&gt;&lt;P&gt;Division B,2&lt;/P&gt;&lt;P&gt;Division C,3&lt;/P&gt;&lt;P&gt;Division D,4&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NoConcatenate&lt;/P&gt;&lt;P&gt;DivisionsList:&lt;/P&gt;&lt;P&gt;LOAD Distinct Division as DivisionIS&lt;/P&gt;&lt;P&gt;RESIDENT FACT;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let DivisionCount = NoOfRows('DivisionsList')-1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET varDivision = '';&lt;/P&gt;&lt;P&gt;For i = 0 to $(DivisionCount)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET varDivision = varDivision &amp;amp; if($(i)&amp;gt;=1,chr(59)) &amp;amp; Peek('DivisionIS',$(i),'DivisionsList');&lt;/P&gt;&lt;P&gt;Next i&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Aug 2016 09:23:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Is-it-possible-to-set-a-field-into-a-variable-in-the-load-script/m-p/1139092#M373555</guid>
      <dc:creator>vinieme12</dc:creator>
      <dc:date>2016-08-19T09:23:37Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to set a field into a variable in the load script</title>
      <link>https://community.qlik.com/t5/QlikView/Is-it-possible-to-set-a-field-into-a-variable-in-the-load-script/m-p/1139093#M373556</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Vineeth&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your response, but before I try, because Division is loaded in as an inline, it is not actually referencing the actual field held in a&amp;nbsp; different table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There will be other fields that I need to apply the same logic too, some of the fields hold hundreds of values, so would an inline still work in those instances?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards&lt;/P&gt;&lt;P&gt;Helen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Aug 2016 09:29:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Is-it-possible-to-set-a-field-into-a-variable-in-the-load-script/m-p/1139093#M373556</guid>
      <dc:creator>helen_pip</dc:creator>
      <dc:date>2016-08-19T09:29:03Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to set a field into a variable in the load script</title>
      <link>https://community.qlik.com/t5/QlikView/Is-it-possible-to-set-a-field-into-a-variable-in-the-load-script/m-p/1139094#M373557</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've just loaded inline to duplicate the scenario of your fact table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You should Load your FACT tables as usual , what you really need is the table with distinct division values&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f2f2f2;"&gt;DivisionsList:&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f2f2f2;"&gt;LOAD Distinct Division as DivisionIS&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f2f2f2;"&gt;RESIDENT FACT;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f2f2f2;"&gt;let DivisionCount = NoOfRows('DivisionsList')-1;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f2f2f2;"&gt;LET varDivision = '';&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f2f2f2;"&gt;For i = 0 to $(DivisionCount)&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f2f2f2;"&gt;LET varDivision = varDivision &amp;amp; if($(i)&amp;gt;=1,chr(59)) &amp;amp; Peek('DivisionIS',$(i),'DivisionsList');&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f2f2f2;"&gt;Next i&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Steps&lt;/STRONG&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;LOAD FACT&lt;/LI&gt;&lt;LI&gt;Load a Table to hold distinct values, that you need to store in variable&lt;/LI&gt;&lt;LI&gt;loop over the distinct values and add to variable&lt;/LI&gt;&lt;/OL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Aug 2016 09:31:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Is-it-possible-to-set-a-field-into-a-variable-in-the-load-script/m-p/1139094#M373557</guid>
      <dc:creator>vinieme12</dc:creator>
      <dc:date>2016-08-19T09:31:50Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to set a field into a variable in the load script</title>
      <link>https://community.qlik.com/t5/QlikView/Is-it-possible-to-set-a-field-into-a-variable-in-the-load-script/m-p/1139095#M373558</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I shall give it a go and let you know how I get on&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your efforts&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards&lt;/P&gt;&lt;P&gt;Helen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Aug 2016 09:33:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Is-it-possible-to-set-a-field-into-a-variable-in-the-load-script/m-p/1139095#M373558</guid>
      <dc:creator>helen_pip</dc:creator>
      <dc:date>2016-08-19T09:33:14Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to set a field into a variable in the load script</title>
      <link>https://community.qlik.com/t5/QlikView/Is-it-possible-to-set-a-field-into-a-variable-in-the-load-script/m-p/1139096#M373559</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Vineeth&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your example certainly worked with the Division added in from the fact table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have now tried adding in another field in the same fashion, but now the script is erroring, would it be o.k. to take a look, and let me know where I can correct it, and then I know exactly how the process works when I need to add more variables&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Temp:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;Division,&lt;/P&gt;&lt;P&gt;Care_Group&lt;/P&gt;&lt;P&gt;resident&lt;/P&gt;&lt;P&gt;main_data;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NoConcatenate&lt;/P&gt;&lt;P&gt;TempList:&lt;/P&gt;&lt;P&gt;LOAD Distinct Division as DivisionIS,&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; Care_Group as Care_GroupIS&lt;/P&gt;&lt;P&gt;Resident main_data;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let DivisionCount = NoOfRows('TempList')-1;&lt;/P&gt;&lt;P&gt;let Care_GroupCount = NoOfRows('Templist')-1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vField_OPD1_Table = '';&lt;/P&gt;&lt;P&gt;LET vField_OPD2_Table = '';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For i = 0 to $(DivisionCount)&lt;/P&gt;&lt;P&gt;For i = 0 to $(Care_GroupCount)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vField_OPD1_Table = varDivision &amp;amp; if($(i)&amp;gt;=1,chr(59)) &amp;amp; Peek('DivisionIS',$(i),'TempList');&lt;/P&gt;&lt;P&gt;LET vField_OPD2_Table = varCare_Group &amp;amp; if($(i)&amp;gt;=1,chr(59)) &amp;amp; Peek('Care_GroupIS',$(i),'TempList');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Next i&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Aug 2016 11:09:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Is-it-possible-to-set-a-field-into-a-variable-in-the-load-script/m-p/1139096#M373559</guid>
      <dc:creator>helen_pip</dc:creator>
      <dc:date>2016-08-19T11:09:57Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to set a field into a variable in the load script</title>
      <link>https://community.qlik.com/t5/QlikView/Is-it-possible-to-set-a-field-into-a-variable-in-the-load-script/m-p/1139097#M373560</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Temp:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;Division,&lt;/P&gt;&lt;P&gt;Care_Group&lt;/P&gt;&lt;P&gt;resident&lt;/P&gt;&lt;P&gt;main_data;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NoConcatenate&lt;/P&gt;&lt;P&gt;TempList:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp; concat(Distinct Division,',') as DivisionIS,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; concat(Distinct Care_Group,',') as Care_GroupIS&lt;/P&gt;&lt;P&gt;Resident Temp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let varDivision = peek('DivisionIS',0,'TempList');&lt;/P&gt;&lt;P&gt;Let varCareGroup = peek('Care_GroupIS',0,'TempList');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drop table TempList;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Aug 2016 12:11:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Is-it-possible-to-set-a-field-into-a-variable-in-the-load-script/m-p/1139097#M373560</guid>
      <dc:creator>vinieme12</dc:creator>
      <dc:date>2016-08-19T12:11:18Z</dc:date>
    </item>
  </channel>
</rss>

