<?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: CROSS APPLY SQL FUNCTION in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/CROSS-APPLY-SQL-FUNCTION/m-p/445394#M166129</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is no simple way to take QlikView data (resident tables of qvd), push it back to the RDMBS and make a CROSS APPLY there. (You can make some kludgy solutions pushing data back to the DB using macros in QlikView, but I wouldn't recommend it.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Having said that, I would like to know why you would want to use a CROSS APPLY. I have not yet found a JOIN/APPLY data modelling problem that cannot be solved by the internal QlikView functions and table operators, such as Join, Keep, Intervalmatch and Applymap().&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See for instance &lt;A _jive_internal="true" class="loading" href="https://community.qlik.com/blogs/qlikviewdesignblog/2012/09/18/one-favorite-function-applymap" title="http://community.qlik.com/blogs/qlikviewdesignblog/2012/09/18/one-favorite-function-applymap"&gt;http://community.qlik.com/blogs/qlikviewdesignblog/2012/09/18/one-favorite-function-applymap&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HIC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 22 Jan 2013 19:07:48 GMT</pubDate>
    <dc:creator>hic</dc:creator>
    <dc:date>2013-01-22T19:07:48Z</dc:date>
    <item>
      <title>CROSS APPLY SQL FUNCTION</title>
      <link>https://community.qlik.com/t5/QlikView/CROSS-APPLY-SQL-FUNCTION/m-p/445391#M166126</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How to do a CROSS APPLY (sql function)&amp;nbsp; in qlikview, using resident tables or qvd?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jan 2013 18:41:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/CROSS-APPLY-SQL-FUNCTION/m-p/445391#M166126</guid>
      <dc:creator>farolito20</dc:creator>
      <dc:date>2013-01-22T18:41:46Z</dc:date>
    </item>
    <item>
      <title>Re: CROSS APPLY SQL FUNCTION</title>
      <link>https://community.qlik.com/t5/QlikView/CROSS-APPLY-SQL-FUNCTION/m-p/445392#M166127</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Without the context of what you're trying to accomplish, I'm not sure I can give you an in depth answer.&amp;nbsp; But I would look into the ApplyMap function and see if that answers your question.&amp;nbsp; If not, can you give some more details of what you're looking to do, possibly providing an example as well?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jan 2013 18:48:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/CROSS-APPLY-SQL-FUNCTION/m-p/445392#M166127</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-01-22T18:48:52Z</dc:date>
    </item>
    <item>
      <title>Re: CROSS APPLY SQL FUNCTION</title>
      <link>https://community.qlik.com/t5/QlikView/CROSS-APPLY-SQL-FUNCTION/m-p/445393#M166128</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a table1 with codContract, Month, Year, Active&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An other table2 with the mostRecent Month, Year to codContract.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, if Active=0 I need to replace my Month.Year field from table1 with&amp;nbsp;&amp;nbsp; Month, Year from table2&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jan 2013 18:52:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/CROSS-APPLY-SQL-FUNCTION/m-p/445393#M166128</guid>
      <dc:creator>farolito20</dc:creator>
      <dc:date>2013-01-22T18:52:43Z</dc:date>
    </item>
    <item>
      <title>Re: CROSS APPLY SQL FUNCTION</title>
      <link>https://community.qlik.com/t5/QlikView/CROSS-APPLY-SQL-FUNCTION/m-p/445394#M166129</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is no simple way to take QlikView data (resident tables of qvd), push it back to the RDMBS and make a CROSS APPLY there. (You can make some kludgy solutions pushing data back to the DB using macros in QlikView, but I wouldn't recommend it.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Having said that, I would like to know why you would want to use a CROSS APPLY. I have not yet found a JOIN/APPLY data modelling problem that cannot be solved by the internal QlikView functions and table operators, such as Join, Keep, Intervalmatch and Applymap().&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See for instance &lt;A _jive_internal="true" class="loading" href="https://community.qlik.com/blogs/qlikviewdesignblog/2012/09/18/one-favorite-function-applymap" title="http://community.qlik.com/blogs/qlikviewdesignblog/2012/09/18/one-favorite-function-applymap"&gt;http://community.qlik.com/blogs/qlikviewdesignblog/2012/09/18/one-favorite-function-applymap&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HIC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jan 2013 19:07:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/CROSS-APPLY-SQL-FUNCTION/m-p/445394#M166129</guid>
      <dc:creator>hic</dc:creator>
      <dc:date>2013-01-22T19:07:48Z</dc:date>
    </item>
    <item>
      <title>Re: CROSS APPLY SQL FUNCTION</title>
      <link>https://community.qlik.com/t5/QlikView/CROSS-APPLY-SQL-FUNCTION/m-p/445395#M166130</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can probably use IF statements on the Month and Year fields in Table1 to return the most recent Month and Year using the Active field as a condition.&amp;nbsp; You may have to convert the Month and Year fields into variables though.&amp;nbsp; There probably is a more eloquent use but this is quick and dirty.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jan 2013 19:17:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/CROSS-APPLY-SQL-FUNCTION/m-p/445395#M166130</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-01-22T19:17:53Z</dc:date>
    </item>
    <item>
      <title>Re: CROSS APPLY SQL FUNCTION</title>
      <link>https://community.qlik.com/t5/QlikView/CROSS-APPLY-SQL-FUNCTION/m-p/445396#M166131</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table2Map:&lt;/P&gt;&lt;P&gt;Mapping Load &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;codContract, MakeDate(Year,Month);&lt;/P&gt;&lt;P&gt;SQL SELECT codContract, Year, Month FROM table2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table1:&lt;/P&gt;&lt;P&gt;Load &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;codContract, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;YearMonth,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Month(YearMonth) as Month, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Year(YearMonth) as Year, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Active;&lt;/P&gt;&lt;P&gt;Load &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;codContract, Month, Year, Active,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(Active=0,Applymap('Table2Map',MakeDate(Year,Month)),MakeDate(Year,Month)) as YearMonth;&lt;/P&gt;&lt;P&gt;SQL SELECT * FROM table1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HIC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jan 2013 19:22:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/CROSS-APPLY-SQL-FUNCTION/m-p/445396#M166131</guid>
      <dc:creator>hic</dc:creator>
      <dc:date>2013-01-22T19:22:50Z</dc:date>
    </item>
    <item>
      <title>Re: CROSS APPLY SQL FUNCTION</title>
      <link>https://community.qlik.com/t5/QlikView/CROSS-APPLY-SQL-FUNCTION/m-p/445397#M166132</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is just like a join on no fields in both tables. it should look like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TabelA:&lt;/P&gt;&lt;P&gt;1,&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;From SQLTableA;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;left join (TableA)&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;TabelB:&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;3&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;From SQLTableB;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;TableC: //This table is like using the cross apply because this is where you use the where conditions to reduce the dataset.&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Load &lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;1,&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;2,&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;3&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;resident TableA&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Where ......;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 May 2017 09:58:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/CROSS-APPLY-SQL-FUNCTION/m-p/445397#M166132</guid>
      <dc:creator>richard</dc:creator>
      <dc:date>2017-05-01T09:58:12Z</dc:date>
    </item>
  </channel>
</rss>

