<?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 SV:Running a where clause from a SQL table in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Running-a-where-clause-from-a-SQL-table/m-p/205284#M61830</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unfortunately not, the database where the F0911 is held is in a different place to the SQL table, any ideas?&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Ben&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 08 Jan 2010 11:14:40 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-01-08T11:14:40Z</dc:date>
    <item>
      <title>Running a where clause from a SQL table</title>
      <link>https://community.qlik.com/t5/QlikView/Running-a-where-clause-from-a-SQL-table/m-p/205282#M61828</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all, I am current using this load statement to create QVD's:&lt;/P&gt;&lt;P style="font-style: italic; line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;General_Ledger:&lt;/P&gt;&lt;P style="font-weight: bold; line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;////=============================================================================================&lt;/P&gt;&lt;P style="font-weight: bold; line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;// TABLE NAME: F0911&lt;/P&gt;&lt;P style="font-weight: bold; line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;////=============================================================================================&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;B&gt;LOAD&lt;/B&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;B&gt;//&lt;/B&gt; GLKCO as [Company],&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;GLDCT &lt;B&gt;as&lt;/B&gt; [Document Type],&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;GLDOC &lt;B&gt;as&lt;/B&gt; [GL Document No],&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;B&gt;//&lt;/B&gt; GLDGJ,&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;date(MakeDate(1900+left(text(GLDGJ),len(GLDGJ)-3))+right(text(GLDGJ),3)-1) &lt;B&gt;as&lt;/B&gt; [GL Date],&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;GLAID &lt;B&gt;as&lt;/B&gt; [Account ID],&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;B&gt;//&lt;/B&gt; GLMCU as [Cost Centre],&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;B&gt;//&lt;/B&gt; GLOBJ as [Object Account],&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;TEXT (GLPN) &lt;B&gt;as&lt;/B&gt; [Period],&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;GLAA/100 &lt;B&gt;as&lt;/B&gt; [GL Amount],&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;GLEXA &lt;B&gt;as&lt;/B&gt; [GL Description],&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;GLEXR &lt;B&gt;as&lt;/B&gt; [GL Remark],&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;GLAN8 &lt;B&gt;as&lt;/B&gt; [Address No],&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;GLPO &lt;B&gt;as&lt;/B&gt; [Purchase Order No],&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;GLFY,&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;GLLT;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;B&gt;SQL&lt;/B&gt; &lt;B&gt;SELECT&lt;/B&gt; *&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;B&gt;FROM&lt;/B&gt; TRDTA.F0911;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;B&gt;Store&lt;/B&gt; General_Ledger &lt;B&gt;INTO&lt;/B&gt; Data/General_Ledger.qvd;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, there are some 9 million records in this table, what I want to be able to do is only see the records that relate to a list of Cost Centre's that I have held in a SQL table, the reason for them being held in the SQL table is so that the list can be updated and changed. Therefore what I need to find out is, is there a way to have the where clause look at and include the values held in this sql table so the final version looks something like this:&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P style="font-style: italic; line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;General_Ledger:&lt;/P&gt;&lt;P style="font-weight: bold; line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;////=============================================================================================&lt;/P&gt;&lt;P style="font-weight: bold; line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;// TABLE NAME: F0911&lt;/P&gt;&lt;P style="font-weight: bold; line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;////=============================================================================================&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;B&gt;LOAD&lt;/B&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;B&gt;//&lt;/B&gt; GLKCO as [Company],&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;GLDCT &lt;B&gt;as&lt;/B&gt; [Document Type],&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;GLDOC &lt;B&gt;as&lt;/B&gt; [GL Document No],&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;B&gt;//&lt;/B&gt; GLDGJ,&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;date(MakeDate(1900+left(text(GLDGJ),len(GLDGJ)-3))+right(text(GLDGJ),3)-1) &lt;B&gt;as&lt;/B&gt; [GL Date],&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;GLAID &lt;B&gt;as&lt;/B&gt; [Account ID],&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;B&gt;//&lt;/B&gt; GLMCU as [Cost Centre],&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;B&gt;//&lt;/B&gt; GLOBJ as [Object Account],&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;TEXT (GLPN) &lt;B&gt;as&lt;/B&gt; [Period],&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;GLAA/100 &lt;B&gt;as&lt;/B&gt; [GL Amount],&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;GLEXA &lt;B&gt;as&lt;/B&gt; [GL Description],&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;GLEXR &lt;B&gt;as&lt;/B&gt; [GL Remark],&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;GLAN8 &lt;B&gt;as&lt;/B&gt; [Address No],&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;GLPO &lt;B&gt;as&lt;/B&gt; [Purchase Order No],&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;GLFY,&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;GLLT;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;B&gt;SQL&lt;/B&gt; &lt;B&gt;SELECT&lt;/B&gt; *&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;B&gt;FROM&lt;/B&gt; TRDTA.F0911 &lt;STRONG&gt;WHERE "SQLTABLE1.COST_CENTRE" = 'Cost Centre'&lt;/STRONG&gt;;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;B&gt;Store&lt;/B&gt; General_Ledger &lt;B&gt;INTO&lt;/B&gt; Data/General_Ledger.qvd;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas anyone?&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Ben&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jan 2010 10:47:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Running-a-where-clause-from-a-SQL-table/m-p/205282#M61828</guid>
      <dc:creator />
      <dc:date>2010-01-08T10:47:35Z</dc:date>
    </item>
    <item>
      <title>SV:Running a where clause from a SQL table</title>
      <link>https://community.qlik.com/t5/QlikView/Running-a-where-clause-from-a-SQL-table/m-p/205283#M61829</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is the table in the same database? If so:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SELECT * FROM TRDTA.F0911 WHERE GLMCU IN (select distinct COST_CENTRE from SQLTABLE1)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;/Michael&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jan 2010 10:58:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Running-a-where-clause-from-a-SQL-table/m-p/205283#M61829</guid>
      <dc:creator />
      <dc:date>2010-01-08T10:58:43Z</dc:date>
    </item>
    <item>
      <title>SV:Running a where clause from a SQL table</title>
      <link>https://community.qlik.com/t5/QlikView/Running-a-where-clause-from-a-SQL-table/m-p/205284#M61830</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unfortunately not, the database where the F0911 is held is in a different place to the SQL table, any ideas?&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Ben&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jan 2010 11:14:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Running-a-where-clause-from-a-SQL-table/m-p/205284#M61830</guid>
      <dc:creator />
      <dc:date>2010-01-08T11:14:40Z</dc:date>
    </item>
    <item>
      <title>SV:Re: SV:Running a where clause from a SQL table</title>
      <link>https://community.qlik.com/t5/QlikView/Running-a-where-clause-from-a-SQL-table/m-p/205285#M61831</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could do it with the exists function. Load the sqltable1 first and then only load the existing ones from F0911.&lt;/P&gt;&lt;P&gt;Not excactly sure if the code below works as is but something like that.&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;Load COST_CENTRE&lt;BR /&gt;SQL SELECT distinct COST_CENTRE from SQLTABLE1;&lt;BR /&gt;Load .....(Other columns),&lt;BR /&gt; GLMCU as [Cost Centre]&lt;BR /&gt;WHERE EXISTS(COST_CENTRE,GLMCU)&lt;BR /&gt;SQL SELECT *&lt;BR /&gt;FROM TRDTA.F0911;&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;/Michael&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jan 2010 13:25:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Running-a-where-clause-from-a-SQL-table/m-p/205285#M61831</guid>
      <dc:creator />
      <dc:date>2010-01-08T13:25:41Z</dc:date>
    </item>
  </channel>
</rss>

