<?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: Re: create a map using &amp;quot;Where&amp;quot; in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/create-a-map-using-quot-Where-quot/m-p/525492#M1120283</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How about this? Note that your situation may be slightly different. The attachment only explains a method to get the oldest instances using GROUP BY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 17 Jan 2014 09:36:56 GMT</pubDate>
    <dc:creator>Peter_Cammaert</dc:creator>
    <dc:date>2014-01-17T09:36:56Z</dc:date>
    <item>
      <title>create a map using "Where"</title>
      <link>https://community.qlik.com/t5/QlikView/create-a-map-using-quot-Where-quot/m-p/525488#M1120279</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi Experts&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm looking to create a conditional map from my lENDERS table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The logic I need to apply is :&lt;/P&gt;&lt;P&gt;If&amp;nbsp; Prev_Activity_Description = '123 Customer' AND its the First (Earliest value transaction date) [Pre_Txn_Date] then load the field Process_Instance with SME as the flag.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'll then use this map in a later table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any guidence really appreciated - I've tried the below but Im getting a pop up error - execution of script failed&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;A&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My_Map:&lt;/P&gt;&lt;P&gt;MAPPING LOAD Process_instance, 'SME' as Flag&lt;/P&gt;&lt;P&gt;RESIDENT lENDERS&lt;/P&gt;&lt;P&gt;where Prev_Activity_Description = '123 Customer' and min(Pre_Txn_Date)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;EM style="font-size: 8pt;"&gt;&amp;nbsp; &lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jan 2014 08:35:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/create-a-map-using-quot-Where-quot/m-p/525488#M1120279</guid>
      <dc:creator />
      <dc:date>2014-01-17T08:35:22Z</dc:date>
    </item>
    <item>
      <title>Re: create a map using "Where"</title>
      <link>https://community.qlik.com/t5/QlikView/create-a-map-using-quot-Where-quot/m-p/525489#M1120280</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;the min()-part in your MAPPING LOAD is wrong. Min() is an aggregation function and needs a GROUP BY clause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use a two-step approach:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Reduce your table to only those transactions with the earliest date. Use GROUP BY to order them by transaciton ID or something.&lt;/LI&gt;&lt;LI&gt;Create a mapping table by copying the previous one and filtering out those that do not fit the '123 Customer' requirement.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jan 2014 08:40:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/create-a-map-using-quot-Where-quot/m-p/525489#M1120280</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2014-01-17T08:40:57Z</dc:date>
    </item>
    <item>
      <title>Re: create a map using "Where"</title>
      <link>https://community.qlik.com/t5/QlikView/create-a-map-using-quot-Where-quot/m-p/525490#M1120281</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Peter&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know how to create a table by loading from my existing table lENDERS , but I'm not sure how to write the code in order to reduce it by earliest transaction.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is what I would need :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;Process_Instance,&lt;/P&gt;&lt;P&gt;Previous_Activity_Description as [PreAct]&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ( because I need to change the name to prevent syn keys)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when [Pre_Txn_Date] is the earliest one across all instances.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you help with the actual coding ? I beieve the logic is sound.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a mill&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jan 2014 09:00:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/create-a-map-using-quot-Where-quot/m-p/525490#M1120281</guid>
      <dc:creator />
      <dc:date>2014-01-17T09:00:35Z</dc:date>
    </item>
    <item>
      <title>Re: create a map using "Where"</title>
      <link>https://community.qlik.com/t5/QlikView/create-a-map-using-quot-Where-quot/m-p/525491#M1120282</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;MinDate:&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;LOAD&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;min(Pre_Txn_Date) AS MinTxnDate&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;RESIDENT &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;lENDERS&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;//Get and store Minimum date&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;LET vDateMin = FieldValue('&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;MinTxnDate&lt;/SPAN&gt;', 1);&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;DROP TABLE &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;MinDate&lt;/SPAN&gt;;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;My_Map:&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;MAPPING LOAD Process_instance, 'SME' as Flag&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;RESIDENT lENDERS&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;where Prev_Activity_Description = '123 Customer' and &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Pre_Txn_Date&lt;/SPAN&gt; = Date('$(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;vDateMin&lt;/SPAN&gt;)');&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Hope this helps you.&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Regards,&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Jagan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jan 2014 09:11:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/create-a-map-using-quot-Where-quot/m-p/525491#M1120282</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2014-01-17T09:11:16Z</dc:date>
    </item>
    <item>
      <title>Re: Re: create a map using "Where"</title>
      <link>https://community.qlik.com/t5/QlikView/create-a-map-using-quot-Where-quot/m-p/525492#M1120283</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How about this? Note that your situation may be slightly different. The attachment only explains a method to get the oldest instances using GROUP BY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jan 2014 09:36:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/create-a-map-using-quot-Where-quot/m-p/525492#M1120283</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2014-01-17T09:36:56Z</dc:date>
    </item>
    <item>
      <title>Re: create a map using "Where"</title>
      <link>https://community.qlik.com/t5/QlikView/create-a-map-using-quot-Where-quot/m-p/525493#M1120284</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a mill guys&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm just going through it now as I am getting expected results. I'll let you know if I get it working&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again for your help &lt;BR /&gt;A&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jan 2014 09:49:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/create-a-map-using-quot-Where-quot/m-p/525493#M1120284</guid>
      <dc:creator />
      <dc:date>2014-01-17T09:49:45Z</dc:date>
    </item>
  </channel>
</rss>

