<?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 Help with Lookup() function in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Help-with-Lookup-function/m-p/242444#M1206978</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is exactely what I simulated in my code! It is just giving you end of quarter, but it could be anything. Just copy/paste my code and in a new QV and you will see.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 11 Feb 2010 19:28:27 GMT</pubDate>
    <dc:creator>disqr_rm</dc:creator>
    <dc:date>2010-02-11T19:28:27Z</dc:date>
    <item>
      <title>Help with Lookup() function</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-Lookup-function/m-p/242440#M1206969</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm having problems with the Lookup function.&lt;/P&gt;&lt;P&gt;In my load script, I've declared a variable that holds a date:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;SET vLatestPOSDate = Date(CurrentPOSWk)&lt;/P&gt;&lt;P&gt;Now, I would like to use vLatestPOSDate to perform a table lookup. I have a table named 'FiscalCalendarFinal' that has a field called 'FiscCalEndDate'. So here's my lookup function:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;SET vCurrentQtr = Lookup('FiscCalQtr', 'FiscCalEndDate', $(vLatestPOSDate), 'FiscalCalendarFinal');&lt;/P&gt;&lt;P&gt;vCurrentQtr returns no value. Am I using this function correctly? Why isn't it returning a value?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Feb 2010 18:44:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-Lookup-function/m-p/242440#M1206969</guid>
      <dc:creator />
      <dc:date>2010-02-11T18:44:42Z</dc:date>
    </item>
    <item>
      <title>Help with Lookup() function</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-Lookup-function/m-p/242441#M1206970</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to use LET and not SET.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Feb 2010 18:54:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-Lookup-function/m-p/242441#M1206970</guid>
      <dc:creator>disqr_rm</dc:creator>
      <dc:date>2010-02-11T18:54:59Z</dc:date>
    </item>
    <item>
      <title>Help with Lookup() function</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-Lookup-function/m-p/242442#M1206971</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is an example for you:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;let CurrentPOSWk = today();&lt;BR /&gt;SET vLatestPOSDate = Date(CurrentPOSWk);&lt;BR /&gt;FiscalCalendarFinal:&lt;BR /&gt;LOAD&lt;BR /&gt;*, QuarterEnd(FiscCalEndDate) as FiscCalQtr;&lt;BR /&gt;LOAD&lt;BR /&gt; date(today()+100-recno()) as FiscCalEndDate&lt;BR /&gt;AUTOGENERATE 300;&lt;BR /&gt;Let vCurrentQtr = Lookup('FiscCalQtr', 'FiscCalEndDate', $(vLatestPOSDate), 'FiscalCalendarFinal')&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Feb 2010 18:56:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-Lookup-function/m-p/242442#M1206971</guid>
      <dc:creator>disqr_rm</dc:creator>
      <dc:date>2010-02-11T18:56:17Z</dc:date>
    </item>
    <item>
      <title>Help with Lookup() function</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-Lookup-function/m-p/242443#M1206975</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry. Perhaps my original post wasn't clear:&lt;/P&gt;&lt;P&gt;I have a table called FiscalCalendarFinal. I have fields called FiscCalEndDate (primary key) and FiscCalQtr. FiscCalQtr is a string field containing a value (e.g., 'Q4'). FiscCalEndDate is a Date. I would like to use Lookup function, as follows:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;vLatestPOSDate is already correctly set&lt;/LI&gt;&lt;LI&gt;I would like to use vLatestPOSDate to perform a Lookup in FiscalCalendarFinal. It should match against FiscCalEndDate and return FiscCalQtr. FiscCalQtr is a string value (e.g., 'Q4')&lt;/LI&gt;&lt;LI&gt;I would like to SET the value of vCurrentQuarter. LET will not work on a string value.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Can this be done?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Feb 2010 19:25:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-Lookup-function/m-p/242443#M1206975</guid>
      <dc:creator />
      <dc:date>2010-02-11T19:25:30Z</dc:date>
    </item>
    <item>
      <title>Help with Lookup() function</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-Lookup-function/m-p/242444#M1206978</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is exactely what I simulated in my code! It is just giving you end of quarter, but it could be anything. Just copy/paste my code and in a new QV and you will see.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Feb 2010 19:28:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-Lookup-function/m-p/242444#M1206978</guid>
      <dc:creator>disqr_rm</dc:creator>
      <dc:date>2010-02-11T19:28:27Z</dc:date>
    </item>
    <item>
      <title>Help with Lookup() function</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-Lookup-function/m-p/242445#M1206979</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It doesn't work&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Feb 2010 19:33:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-Lookup-function/m-p/242445#M1206979</guid>
      <dc:creator />
      <dc:date>2010-02-11T19:33:39Z</dc:date>
    </item>
    <item>
      <title>Help with Lookup() function</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-Lookup-function/m-p/242446#M1206980</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry, but FiscCalQtr is a STRING...not numeric value. Your example doesn't work in MY script. I get what you are trying to do. Does FiscCalQtr need to be NUMERIC vs. STRING?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Feb 2010 19:38:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-Lookup-function/m-p/242446#M1206980</guid>
      <dc:creator />
      <dc:date>2010-02-11T19:38:01Z</dc:date>
    </item>
    <item>
      <title>Help with Lookup() function</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-Lookup-function/m-p/242447#M1206981</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Once again, I haven't been clear. LOL. I'm asking if Lookup() returns only a numeric value, or if it can return a string.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Feb 2010 19:40:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-Lookup-function/m-p/242447#M1206981</guid>
      <dc:creator />
      <dc:date>2010-02-11T19:40:48Z</dc:date>
    </item>
    <item>
      <title>Help with Lookup() function</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-Lookup-function/m-p/242448#M1206982</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;let CurrentPOSWk = today();&lt;BR /&gt;SET vLatestPOSDate = Date(CurrentPOSWk);&lt;BR /&gt;FiscalCalendarFinal:&lt;BR /&gt;LOAD *,&lt;BR /&gt; 'Q' &amp;amp; ceil(month(FiscCalEndDate)/3) as FiscCalQtr;&lt;BR /&gt;LOAD&lt;BR /&gt; date(today()+100-recno()) as FiscCalEndDate&lt;BR /&gt;AUTOGENERATE 300;&lt;BR /&gt;Let vCurrentQtr = Lookup('FiscCalQtr', 'FiscCalEndDate', $(vLatestPOSDate), 'FiscalCalendarFinal')&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;The same code returns string FiscCalQtr. Lokkup() function will work with any datatype.&lt;/P&gt;&lt;P&gt;May be you want to conver your date fields to num() and then to lookup. Internally, all dates are stored as numeric values, so if you are comparing a string date to numeric date, that wouldn't work.&lt;/P&gt;&lt;P&gt;Still a problem, may be you should post your code here,and someone will get you solution.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Feb 2010 23:04:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-Lookup-function/m-p/242448#M1206982</guid>
      <dc:creator>disqr_rm</dc:creator>
      <dc:date>2010-02-11T23:04:21Z</dc:date>
    </item>
    <item>
      <title>Help with Lookup() function</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-Lookup-function/m-p/242449#M1206983</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your help! It worked &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Feb 2010 18:50:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-Lookup-function/m-p/242449#M1206983</guid>
      <dc:creator />
      <dc:date>2010-02-12T18:50:00Z</dc:date>
    </item>
  </channel>
</rss>

