<?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: Using Lookup to set the value of a variable in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Using-Lookup-to-set-the-value-of-a-variable/m-p/1575428#M442507</link>
    <description>&lt;P&gt;Hi Paul,&lt;/P&gt;&lt;P&gt;I've had similar situations and ended using the Only() function:&lt;/P&gt;&lt;P&gt;e.g.&lt;/P&gt;&lt;P&gt;I needed to find the year from my MasterCalandar based on yesterdays date:&lt;/P&gt;&lt;P&gt;=only({&amp;lt;DateID={'$(=num(today())-1)'}&amp;gt;}[Acct Year])&lt;/P&gt;&lt;P&gt;So you can see that I'm returning [Acct Year] where my DateID is yesterday.&lt;/P&gt;&lt;P&gt;I'm sure you can adapt this quite easily to suit your needs?&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;</description>
    <pubDate>Wed, 01 May 2019 08:46:46 GMT</pubDate>
    <dc:creator>chris1987</dc:creator>
    <dc:date>2019-05-01T08:46:46Z</dc:date>
    <item>
      <title>Using Lookup to set the value of a variable</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Lookup-to-set-the-value-of-a-variable/m-p/599778#M221993</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to lookup a field value based on a user selection, I am using Lookup() , but I'm guessing I'm doing something incorrect as I cannot see this working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is being used outside the context of a load, hence am I working outside the scope of this function requirement , I am trying to set the variable dynamically , see below...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;=if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;max&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;CalendarDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) = lookup('CurrentTo', '[Country Code]', GetFieldSelections(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Country Code]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) , 'DateNow'),1,0) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Paul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Mar 2014 22:02:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Lookup-to-set-the-value-of-a-variable/m-p/599778#M221993</guid>
      <dc:creator>paul_scotchford</dc:creator>
      <dc:date>2014-03-04T22:02:47Z</dc:date>
    </item>
    <item>
      <title>Re: Using Lookup to set the value of a variable</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Lookup-to-set-the-value-of-a-variable/m-p/599779#M221994</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, It will never work, lookup is a script function only, you'll need to think of a different way.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Mar 2014 07:46:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Lookup-to-set-the-value-of-a-variable/m-p/599779#M221994</guid>
      <dc:creator>sbaldwin</dc:creator>
      <dc:date>2014-03-05T07:46:35Z</dc:date>
    </item>
    <item>
      <title>Re: Using Lookup to set the value of a variable</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Lookup-to-set-the-value-of-a-variable/m-p/599780#M221995</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;H4 style="color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"&gt;&lt;STRONG&gt;Hi Steve,&lt;BR /&gt;&lt;/STRONG&gt;&lt;/H4&gt;&lt;H4 style="color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"&gt;&lt;STRONG&gt;lookup&lt;A href="http://michaelandqlikview.blogspot.in/2013/06/qlikview-lookup-function.html" name="kanchor51" style="color: #888888;"&gt;http://michaelandqlikview.blogspot.in/2013/06/qlikview-lookup-function.html&lt;/A&gt;&lt;A href="http://michaelandqlikview.blogspot.in/2013/06/qlikview-lookup-function.html" name="lookup(" style="color: #888888;"&gt;http://michaelandqlikview.blogspot.in/2013/06/qlikview-lookup-function.html&lt;/A&gt;( &lt;SPAN style="font-style: italic;"&gt;fieldname, matchfieldname, matchfieldvalue [, tablename]&lt;/SPAN&gt; )&lt;/STRONG&gt;&lt;/H4&gt;&lt;P&gt;&lt;STRONG style="color: #222222; font-size: x-small; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"&gt;Returns the value of &lt;SPAN style="font-style: italic;"&gt;fieldname&lt;/SPAN&gt; corresponding to the first occurrence of the value &lt;SPAN style="font-style: italic;"&gt;matchfieldvalue&lt;/SPAN&gt; in the field&lt;SPAN style="font-style: italic;"&gt;matchfieldname&lt;/SPAN&gt;. &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #222222; font-size: x-small; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"&gt;&lt;SPAN style="font-style: italic;"&gt;Fieldname&lt;/SPAN&gt;, &lt;SPAN style="font-style: italic;"&gt;matchfieldname&lt;/SPAN&gt; and &lt;SPAN style="font-style: italic;"&gt;tablename&lt;/SPAN&gt; must be given as strings (e.g. quoted literals).&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #222222; font-size: x-small; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"&gt;The search order is load order unless the table is the result of complex operations such as joins, in which case the order is not well defined. &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #222222; font-size: x-small; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"&gt;Both &lt;SPAN style="font-style: italic;"&gt;fieldname&lt;/SPAN&gt; and &lt;SPAN style="font-style: italic;"&gt;matchfieldname&lt;/SPAN&gt; must be fields in the same table, specified by &lt;SPAN style="font-style: italic;"&gt;tablename&lt;/SPAN&gt;. If &lt;SPAN style="font-style: italic;"&gt;tablename&lt;/SPAN&gt; is omitted the current table is assumed. &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #222222; font-size: x-small; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"&gt;If no match is found, null is returned.&lt;/STRONG&gt;&lt;/P&gt;&lt;H2 style="margin-bottom: 1em; font-size: 11px; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; color: #000000;"&gt;&lt;STRONG&gt;Example:&lt;/STRONG&gt;&lt;/H2&gt;&lt;H2 style="margin-bottom: 1em; font-size: 11px; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; color: #000000;"&gt;&lt;STRONG style="color: #222222; font-size: 10pt; line-height: 1.5em;"&gt;lookup('Price', 'ProductID', InvoicedProd, 'pricelist')&lt;/STRONG&gt;&lt;/H2&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="line-height: 1.5em; color: #222222; font-size: x-small; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"&gt;I occasionally have issues using this function - mainly as I try to avoid it anyway.&amp;nbsp; Couple of things from trial and error:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG style="font-size: x-small;"&gt;The field names with the ' ' literal wrapper.&amp;nbsp; DO NOT wrap them with [ ] inside the ' ' even if the field usually needs them.&amp;nbsp; It will confuse Qlikview and won't find your match.&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-size: x-small;"&gt;&lt;STRONG&gt;As it says, should always use the tablename, as usually not trying to use the current table name.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Mar 2014 07:50:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Lookup-to-set-the-value-of-a-variable/m-p/599780#M221995</guid>
      <dc:creator>sunilkumarqv</dc:creator>
      <dc:date>2014-03-05T07:50:52Z</dc:date>
    </item>
    <item>
      <title>Re: Using Lookup to set the value of a variable</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Lookup-to-set-the-value-of-a-variable/m-p/599781#M221996</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Paul,&lt;/P&gt;&lt;P&gt;Can you provide a little more details.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;What value should the variable hold&lt;/LI&gt;&lt;LI&gt;Based on what condition&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;A sample file would also be very helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also as mentioned by Steve Lookup() can't be used on the Front-end.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;AJ&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Mar 2014 19:15:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Lookup-to-set-the-value-of-a-variable/m-p/599781#M221996</guid>
      <dc:creator />
      <dc:date>2014-03-05T19:15:50Z</dc:date>
    </item>
    <item>
      <title>Re: Using Lookup to set the value of a variable</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Lookup-to-set-the-value-of-a-variable/m-p/599782#M221997</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Correct, Yes I found another way where I could avoid a lookup completely.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Mar 2014 21:29:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Lookup-to-set-the-value-of-a-variable/m-p/599782#M221997</guid>
      <dc:creator>paul_scotchford</dc:creator>
      <dc:date>2014-03-05T21:29:52Z</dc:date>
    </item>
    <item>
      <title>Re: Using Lookup to set the value of a variable</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Lookup-to-set-the-value-of-a-variable/m-p/1575235#M442491</link>
      <description>&lt;P&gt;Hi Paul,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It would be great if you could tell me what is the way to write the expression. I'm facing the same issue&lt;/P&gt;</description>
      <pubDate>Tue, 30 Apr 2019 16:46:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Lookup-to-set-the-value-of-a-variable/m-p/1575235#M442491</guid>
      <dc:creator>mohan_1105</dc:creator>
      <dc:date>2019-04-30T16:46:29Z</dc:date>
    </item>
    <item>
      <title>Re: Using Lookup to set the value of a variable</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Lookup-to-set-the-value-of-a-variable/m-p/1575428#M442507</link>
      <description>&lt;P&gt;Hi Paul,&lt;/P&gt;&lt;P&gt;I've had similar situations and ended using the Only() function:&lt;/P&gt;&lt;P&gt;e.g.&lt;/P&gt;&lt;P&gt;I needed to find the year from my MasterCalandar based on yesterdays date:&lt;/P&gt;&lt;P&gt;=only({&amp;lt;DateID={'$(=num(today())-1)'}&amp;gt;}[Acct Year])&lt;/P&gt;&lt;P&gt;So you can see that I'm returning [Acct Year] where my DateID is yesterday.&lt;/P&gt;&lt;P&gt;I'm sure you can adapt this quite easily to suit your needs?&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Wed, 01 May 2019 08:46:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Lookup-to-set-the-value-of-a-variable/m-p/1575428#M442507</guid>
      <dc:creator>chris1987</dc:creator>
      <dc:date>2019-05-01T08:46:46Z</dc:date>
    </item>
    <item>
      <title>Re: Using Lookup to set the value of a variable</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Lookup-to-set-the-value-of-a-variable/m-p/2417833#M1225280</link>
      <description>&lt;P&gt;Thanks for the pointer Chris,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a little table with NTNAME and Employee_Country, and used the following variables to detect Country of current user, so I could use in a show hide expression on a set of tables, where users in certain countries can only see certain columns.&lt;/P&gt;
&lt;P&gt;v_OSUSER = OSUser() ;&lt;/P&gt;
&lt;P&gt;v_User_Country =&amp;nbsp;&amp;nbsp;only({&amp;lt;NTNAME={'$(=$(v_OSUSER))'}&amp;gt;}EMPLOYEE_COUNTRY) ;&lt;/P&gt;
&lt;P&gt;Show hide condition = If&amp;nbsp;( Match(Upper($(v_User_Country)),'XXX','YYY')&amp;gt;0,1,0)&lt;/P&gt;
&lt;P&gt;Regards&amp;nbsp;Greenee&lt;/P&gt;</description>
      <pubDate>Tue, 13 Feb 2024 09:29:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Lookup-to-set-the-value-of-a-variable/m-p/2417833#M1225280</guid>
      <dc:creator>greenee</dc:creator>
      <dc:date>2024-02-13T09:29:07Z</dc:date>
    </item>
  </channel>
</rss>

