<?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: conditonal load in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/conditonal-load/m-p/1150630#M913216</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Would you be able to share the table form which Customer is coming from?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 26 May 2016 12:40:20 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2016-05-26T12:40:20Z</dc:date>
    <item>
      <title>conditonal load</title>
      <link>https://community.qlik.com/t5/QlikView/conditonal-load/m-p/1150623#M913209</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to conditionally load the table based on values in variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the below variable that contain the list of values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vSegTypes = chr(39) &amp;amp; Peek('Customers') &amp;amp; chr(39);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to compare the above values with below variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET vVar1 = No1;&lt;/P&gt;&lt;P&gt;SET vVar2 = No2;&lt;/P&gt;&lt;P&gt;SET vVar3 = No3;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if ($(vSegTypes) = $(vVar1)) or ($(vSegTypes) = $(vVar2)) or ($(vSegTypes) = $(vVar3)) then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; load ....from;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end if&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above if condition is not working. Please help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/conditonal-load/m-p/1150623#M913209</guid>
      <dc:creator>surajap123</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: conditonal load</title>
      <link>https://community.qlik.com/t5/QlikView/conditonal-load/m-p/1150624#M913210</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this may be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;IF $(vSegTypes) = '$(vVar1)' or $(vSegTypes) = '$(vVar2)' or $(vSegTypes) = '$(vVar3)' then&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 May 2016 11:08:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/conditonal-load/m-p/1150624#M913210</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-05-26T11:08:12Z</dc:date>
    </item>
    <item>
      <title>Re: conditonal load</title>
      <link>https://community.qlik.com/t5/QlikView/conditonal-load/m-p/1150625#M913211</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;//On peek you need to write the row number and table.&lt;/P&gt;&lt;P&gt;LET vSegTypes = Peek('Customers',&lt;STRONG&gt;NumberOfReg,'Table'&lt;/STRONG&gt;);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET vVar1 = No1;&lt;/P&gt;&lt;P&gt;SET vVar2 = No2;&lt;/P&gt;&lt;P&gt;SET vVar3 = No3;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//On IF, put your vars into string&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if '$(vSegTypes)' = '$(vVar1)' or '$(vSegTypes)' = '$(vVar2)' or '$(vSegTypes)' = '$(vVar3)' then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; load ....from;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end if&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 May 2016 11:10:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/conditonal-load/m-p/1150625#M913211</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-05-26T11:10:10Z</dc:date>
    </item>
    <item>
      <title>Re: conditonal load</title>
      <link>https://community.qlik.com/t5/QlikView/conditonal-load/m-p/1150626#M913212</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Other option is load table with where condition:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Customers:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ....&lt;/P&gt;&lt;P&gt;RESIDENT YourTable&lt;/P&gt;&lt;P&gt;WHERE Customers = '$(vVar1)' or Customers= '$(vVar2)' or Customers = '$(vVar3)';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 May 2016 11:12:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/conditonal-load/m-p/1150626#M913212</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-05-26T11:12:41Z</dc:date>
    </item>
    <item>
      <title>Re: conditonal load</title>
      <link>https://community.qlik.com/t5/QlikView/conditonal-load/m-p/1150627#M913213</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you want to access variables which contain string-values you need to wrap them with single-quotes like: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'$(vVar)'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;beside them VSegType will be return NULL because peek is applied outside from a load and needs further parameter like: Peek('Customers', &lt;STRONG&gt;RecordNumber, 'Tablename'&lt;/STRONG&gt; ) and then it would be only contain a single value and not a list of values. Here you would need to loop through these field and then probably rather in this way:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for i = 0 to fieldvaluecount('Customers')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; let vSegTypes = fieldvalue('Customers', $(i));&lt;/P&gt;&lt;P&gt;&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;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 May 2016 11:13:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/conditonal-load/m-p/1150627#M913213</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2016-05-26T11:13:04Z</dc:date>
    </item>
    <item>
      <title>Re: conditonal load</title>
      <link>https://community.qlik.com/t5/QlikView/conditonal-load/m-p/1150628#M913214</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;EM&gt;You can also try,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;EM&gt;&lt;STRONG&gt;LET vSegTypes =&amp;nbsp; Peek('Customers') ;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="line-height: 1.5em; font-size: 10pt;"&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="line-height: 1.5em; font-size: 10pt;"&gt;&lt;EM&gt;SET vVar1 = 'No1';&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;SET vVar2 = 'No2';&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;SET vVar3 = 'No3';&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; font-size: 10pt;"&gt;&lt;EM&gt;if vSegTypes = vVar1 or vSegType = vVar2 or vSegTypes = vVar3 then&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; font-size: 10pt;"&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; load ....from;&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM&gt; &lt;/EM&gt;&lt;SPAN style="line-height: 1.5em;"&gt;&lt;EM&gt;&amp;nbsp; end if&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 May 2016 11:19:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/conditonal-load/m-p/1150628#M913214</guid>
      <dc:creator>tamilarasu</dc:creator>
      <dc:date>2016-05-26T11:19:23Z</dc:date>
    </item>
    <item>
      <title>Re: conditonal load</title>
      <link>https://community.qlik.com/t5/QlikView/conditonal-load/m-p/1150629#M913215</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sunny,&amp;nbsp; Thanks for the reply.&lt;/P&gt;&lt;P&gt;I got the Error: Script line error. I see that the variable has null in 3rd condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if 'Field1','Field2' = 'Field5' or &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; 'Field1','Field2' = 'Field8' or &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; 'Field1','Field2' = ''&amp;nbsp; or &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; 'Field1','Field2' = 'Field10'&amp;nbsp; then&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Error: Script line error:&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 May 2016 11:41:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/conditonal-load/m-p/1150629#M913215</guid>
      <dc:creator>surajap123</dc:creator>
      <dc:date>2016-05-26T11:41:32Z</dc:date>
    </item>
    <item>
      <title>Re: conditonal load</title>
      <link>https://community.qlik.com/t5/QlikView/conditonal-load/m-p/1150630#M913216</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Would you be able to share the table form which Customer is coming from?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 May 2016 12:40:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/conditonal-load/m-p/1150630#M913216</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-05-26T12:40:20Z</dc:date>
    </item>
    <item>
      <title>Re: conditonal load</title>
      <link>https://community.qlik.com/t5/QlikView/conditonal-load/m-p/1150631#M913217</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;On seeing your error, it looks like you are concatenating multiple values in to a variable '&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;vSegTypes'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;in that case I prefer to use Match function&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Try something like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;IF Match('$(vVar1)', &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;$(vSegTypes))&lt;/SPAN&gt; or &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Match('$(vVar2)', &lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;$(vSegTypes))&lt;/SPAN&gt; or &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Match('$(vVar3)', &lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;$(vSegTypes))&lt;/SPAN&gt; then&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; load ....from;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp; end if&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 May 2016 13:19:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/conditonal-load/m-p/1150631#M913217</guid>
      <dc:creator>CELAMBARASAN</dc:creator>
      <dc:date>2016-05-26T13:19:57Z</dc:date>
    </item>
    <item>
      <title>Re: conditonal load</title>
      <link>https://community.qlik.com/t5/QlikView/conditonal-load/m-p/1150632#M913218</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks everyone for the support.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 May 2016 15:54:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/conditonal-load/m-p/1150632#M913218</guid>
      <dc:creator>surajap123</dc:creator>
      <dc:date>2016-05-26T15:54:08Z</dc:date>
    </item>
  </channel>
</rss>

