<?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: Variable creation for use in Where Clause in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Variable-creation-for-use-in-Where-Clause/m-p/63006#M605421</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;Create your variable like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;concat(chr(39) &amp;amp; TQ_LibItem &amp;amp; chr(39) ,',')&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;and on the where clause, put this:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;WHERE MATCH(&lt;STRONG style="font-size: 13.3333px;"&gt;TQ_LibItem,'$(your_variable)')&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 06 Jun 2018 07:59:23 GMT</pubDate>
    <dc:creator>YoussefBelloum</dc:creator>
    <dc:date>2018-06-06T07:59:23Z</dc:date>
    <item>
      <title>Variable creation for use in Where Clause</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-creation-for-use-in-Where-Clause/m-p/63004#M605419</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi world,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Need a hand creating a variable to use in a Where clause...&amp;nbsp; This is to replace this current where clause:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where Match([Library Item Identifier],'cychs-bls-skills-assessment','cychs-immunisation-progam-nurse-update-2015','cychs-immunisation-program-nurse-assessment-2015','cychs-ipn-assessment-' (it goes for longer)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The items that are manually written in are all contained within a column from a table called ComponentMappingNull.&amp;nbsp; Here is the column name and the results within:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;TABLE border="1px" cellpadding="0" cellspacing="0" jive-data-cell="{&amp;quot;color&amp;quot;:&amp;quot;#575757&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;left&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;NaN&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;transparent&amp;quot;,&amp;quot;fontFamily&amp;quot;:&amp;quot;arial,helvetica,sans-serif&amp;quot;,&amp;quot;verticalAlign&amp;quot;:&amp;quot;baseline&amp;quot;}" jive-data-header="{&amp;quot;color&amp;quot;:&amp;quot;#FFFFFF&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;#6690BC&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;center&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;2&amp;quot;}" style="width: 280px; border-width: 1px; border-style: solid;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="color: #ffffff; background-color: #6690bc; text-align: center; padding: 2px;"&gt;TQ_LibItem&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" style="color: #575757; text-align: left; background-color: transparent; font-family: arial,helvetica,sans-serif; vertical-align: baseline;"&gt;cychs-bls-skills-assessment&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" style="color: #575757; text-align: left; background-color: transparent; font-family: arial,helvetica,sans-serif; vertical-align: baseline;"&gt;cychs-immunisation-progam-nurse-update-2015&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" style="color: #575757; text-align: left; background-color: transparent; font-family: arial,helvetica,sans-serif; vertical-align: baseline;"&gt;cychs-immunisation-program-nurse-assessment-2015&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" style="color: #575757; text-align: left; background-color: transparent; font-family: arial,helvetica,sans-serif; vertical-align: baseline;"&gt;cychs-ipn-assessment-&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" style="color: #575757; text-align: left; background-color: transparent; font-family: arial,helvetica,sans-serif; vertical-align: baseline;"&gt;cychs-ipn-assessment-2015&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" style="color: #575757; text-align: left; background-color: transparent; font-family: arial,helvetica,sans-serif; vertical-align: baseline;"&gt;cychs-ipn-assessment-2015-2016__&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" style="color: #575757; text-align: left; background-color: transparent; font-family: arial,helvetica,sans-serif; vertical-align: baseline;"&gt;cychs-ipn-assessment-2016&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" style="color: #575757; text-align: left; background-color: transparent; font-family: arial,helvetica,sans-serif; vertical-align: baseline;"&gt;cychs-ipn-assessment-2018&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" style="color: #575757; text-align: left; background-color: transparent; font-family: arial,helvetica,sans-serif; vertical-align: baseline;"&gt;cychs-medication-library-item-1yr-auto-assign-2018&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" style="color: #575757; text-align: left; background-color: transparent; font-family: arial,helvetica,sans-serif; vertical-align: baseline;"&gt;cymhs-bls&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" style="color: #575757; text-align: left; background-color: transparent; font-family: arial,helvetica,sans-serif; vertical-align: baseline;"&gt;cymhs-medication-assessment-community&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" style="color: #575757; text-align: left; background-color: transparent; font-family: arial,helvetica,sans-serif; vertical-align: baseline;"&gt;lcch-medication-assessment-face-to-face&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" style="color: #575757; text-align: left; background-color: transparent; font-family: arial,helvetica,sans-serif; vertical-align: baseline;"&gt;LCCH-pbls-paediatric-basic-life-support-assessment&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I essentially don't want to have to update the where clause script everytime a new value appears in the TQ_LibItem column from the ComponentMappingNull table like I do now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How would this variable or script be written?&amp;nbsp; If that's at all possible...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Carl&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Jun 2018 07:41:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-creation-for-use-in-Where-Clause/m-p/63004#M605419</guid>
      <dc:creator>blunckc1</dc:creator>
      <dc:date>2018-06-06T07:41:05Z</dc:date>
    </item>
    <item>
      <title>Re: Variable creation for use in Where Clause</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-creation-for-use-in-Where-Clause/m-p/63005#M605420</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please have a look at the below link.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/thread/303936#1497808" title="https://community.qlik.com/thread/303936#1497808"&gt;https://community.qlik.com/thread/303936#1497808&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Jun 2018 07:52:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-creation-for-use-in-Where-Clause/m-p/63005#M605420</guid>
      <dc:creator>tamilarasu</dc:creator>
      <dc:date>2018-06-06T07:52:12Z</dc:date>
    </item>
    <item>
      <title>Re: Variable creation for use in Where Clause</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-creation-for-use-in-Where-Clause/m-p/63006#M605421</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;Create your variable like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;concat(chr(39) &amp;amp; TQ_LibItem &amp;amp; chr(39) ,',')&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;and on the where clause, put this:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;WHERE MATCH(&lt;STRONG style="font-size: 13.3333px;"&gt;TQ_LibItem,'$(your_variable)')&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Jun 2018 07:59:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-creation-for-use-in-Where-Clause/m-p/63006#M605421</guid>
      <dc:creator>YoussefBelloum</dc:creator>
      <dc:date>2018-06-06T07:59:23Z</dc:date>
    </item>
    <item>
      <title>Re: Variable creation for use in Where Clause</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-creation-for-use-in-Where-Clause/m-p/63007#M605422</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Youssef,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks, nearly there.&amp;nbsp; Variable (set vTQLibItems = concat(chr(39) &amp;amp; TQ_LibItem &amp;amp; chr(39) ,',');) looks as if it loads correctly when adding a text object with the text of =$(vTQLibItems).&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But then the where clause doesn't return any data in the table it is being applied to:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where ([Library Item Identifier] = '$(vTQLibItems)')&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;Where Match([Library Item Identifier], '$(vTQLibItems)')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The table the Where clause sits in is in a completely separate table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TEACHQDataInput:&lt;/P&gt;&lt;P&gt;LOAD replace(ltrim(replace(Username,'0',' ')),' ','0') as PersonID, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Email, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Library Item Identifier] as TQ_LibItem, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Library Item], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date(CompletedDate) as CompletedDate,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TimeStamp(TEACHQExtractTimeStamp) as TEACHQExtractTimeStamp,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ApplyMap('IPNPID',Username,'No') as IPN?&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;&lt;Y&gt;&lt;/Y&gt;&lt;/P&gt;&lt;P&gt;(qvd)&lt;/P&gt;&lt;P&gt;Where Match([Library Item Identifier], '$(vTQLibItems)');&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Jun 2018 08:28:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-creation-for-use-in-Where-Clause/m-p/63007#M605422</guid>
      <dc:creator>blunckc1</dc:creator>
      <dc:date>2018-06-06T08:28:00Z</dc:date>
    </item>
    <item>
      <title>Re: Variable creation for use in Where Clause</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-creation-for-use-in-Where-Clause/m-p/63008#M605423</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My mistake..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I completely forgot that you should create your variable in the script to be able to use it on the where clause and so it's creation is a bit different on the script, you will need to use Peek() function, like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;temp_table:&lt;/P&gt;&lt;P&gt;LOAD concat(chr(39) &amp;amp; TQ_LibItem &amp;amp; chr(39) ,',') as vTQLibItems&lt;/P&gt;&lt;P&gt;Resident the_table_where_you_have_&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;vTQLibItems&lt;/SPAN&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vTQLibItems = Peek('vTQLibItems');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP Table temp_table;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;==&amp;gt; now you can use your variable the way described above &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/wink.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Jun 2018 08:48:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-creation-for-use-in-Where-Clause/m-p/63008#M605423</guid>
      <dc:creator>YoussefBelloum</dc:creator>
      <dc:date>2018-06-06T08:48:58Z</dc:date>
    </item>
  </channel>
</rss>

