<?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: Select the db based on the column date in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Select-the-db-based-on-the-column-date/m-p/1383785#M807999</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Felipe,&lt;/P&gt;&lt;P&gt;Maybe a subroutine like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sub LoadTable(DB,SourceTableName)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;TRACE;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;TRACE FROM&amp;nbsp;&amp;nbsp; $(DB);&lt;/P&gt;&lt;P&gt;TRACE;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;'$(&lt;SPAN style="font-size: 13.3333px;"&gt;SourceTableName&lt;/SPAN&gt;)'&lt;/SPAN&gt;:&lt;/P&gt;&lt;P&gt; LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp; FIELD1 AS FieldName1,&lt;/P&gt;&lt;P&gt;&amp;nbsp; FIELD2 AS FieldName2,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '$(DB)' AS Source&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;SQL SELECT&lt;/P&gt;&lt;P&gt;FIELD1,&lt;/P&gt;&lt;P&gt;FIELD2,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .&lt;/P&gt;&lt;P&gt;&amp;nbsp; FROM&amp;nbsp;&amp;nbsp; $(DB).SYSADM.$(&lt;SPAN style="font-size: 13.3333px;"&gt;SourceTableName&lt;/SPAN&gt;); *you may need to amend this line to suit your system&lt;/P&gt;&lt;P&gt; End Sub;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can add more arguments if you like. Maybe an argument to give the resident table a name different from the source name or parameters you can put in a WHERE clause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To concatenate just call the subroutine with different arguments&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Call LoadTable('DW201501','XXXX');&lt;/P&gt;&lt;P&gt;Call LoadTable('DW201502','XXXX');&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&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;Andrew&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 18 Oct 2017 07:32:34 GMT</pubDate>
    <dc:creator>effinty2112</dc:creator>
    <dc:date>2017-10-18T07:32:34Z</dc:date>
    <item>
      <title>Select the db based on the column date</title>
      <link>https://community.qlik.com/t5/QlikView/Select-the-db-based-on-the-column-date/m-p/1383780#M807993</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Masters,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have in a server many data bases such as:&lt;/P&gt;&lt;P&gt;DW&lt;STRONG&gt;201501&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;DW&lt;STRONG&gt;201502&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;DW&lt;STRONG&gt;201503&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;DW&lt;STRONG&gt;201601&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;DW&lt;STRONG&gt;201701&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;DW&lt;STRONG&gt;201702&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;DW&lt;STRONG&gt;201703&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;DW&lt;STRONG&gt;201704&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;DW&lt;STRONG&gt;201705&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;It is always 'DW+'Year'+'Month'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After loading a table, &lt;SPAN style="font-size: 10pt;"&gt;I would like to do a join with the correct DB based on the year of a &lt;SPAN style="font-size: 13.3333px;"&gt;column &lt;/SPAN&gt;date . Meaning, if the date is &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;07-March-2015, upon doing the join, the query should search for the DW201503 or any DW2015XX.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it possible?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please advise&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Select-the-db-based-on-the-column-date/m-p/1383780#M807993</guid>
      <dc:creator>felipe_oliveira</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Select the db based on the column date</title>
      <link>https://community.qlik.com/t5/QlikView/Select-the-db-based-on-the-column-date/m-p/1383781#M807994</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If these databases all have the same layout, then you can load &amp;amp; concatenate them all into the same resident table in QlikView. By adding columns that contain the YearMonth value lifted from the database name, you can create a key field that includes these YearMonth values and link to other tables in the usual way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If these database contain a date field with dates that are covered by the period as indicated in the database name, then distilling the period from the database name may not even be needed. But to go any further, you need to explain what data is in these databases and to what content you want to connect them.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Oct 2017 15:42:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Select-the-db-based-on-the-column-date/m-p/1383781#M807994</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2017-10-17T15:42:28Z</dc:date>
    </item>
    <item>
      <title>Re: Select the db based on the column date</title>
      <link>https://community.qlik.com/t5/QlikView/Select-the-db-based-on-the-column-date/m-p/1383782#M807995</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Felipe,&lt;/P&gt;&lt;P&gt;I have a similar situation to you and, as Peter has suggested to you, I concatenate the tables. From each of my databases I extract three large tables. To make it easy I suggest writing a subroutine with the database name as an argument. I have three subroutines and run each of them once for each database to produce my three resident tables.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By concatenating you may not need to do the kind of joins you describe.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Andrew&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Oct 2017 15:56:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Select-the-db-based-on-the-column-date/m-p/1383782#M807995</guid>
      <dc:creator>effinty2112</dc:creator>
      <dc:date>2017-10-17T15:56:03Z</dc:date>
    </item>
    <item>
      <title>Re: Select the db based on the column date</title>
      <link>https://community.qlik.com/t5/QlikView/Select-the-db-based-on-the-column-date/m-p/1383783#M807996</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot! would you have short sample of script that should use to extract, for example, table XXXX from the server and concatenate them?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Oct 2017 17:32:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Select-the-db-based-on-the-column-date/m-p/1383783#M807996</guid>
      <dc:creator>felipe_oliveira</dc:creator>
      <dc:date>2017-10-17T17:32:26Z</dc:date>
    </item>
    <item>
      <title>Re: Select the db based on the column date</title>
      <link>https://community.qlik.com/t5/QlikView/Select-the-db-based-on-the-column-date/m-p/1383784#M807998</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot! would you have a short sample of script that I should use to extract, for example, table XXXX from the server and concatenate them?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Oct 2017 17:33:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Select-the-db-based-on-the-column-date/m-p/1383784#M807998</guid>
      <dc:creator>felipe_oliveira</dc:creator>
      <dc:date>2017-10-17T17:33:00Z</dc:date>
    </item>
    <item>
      <title>Re: Select the db based on the column date</title>
      <link>https://community.qlik.com/t5/QlikView/Select-the-db-based-on-the-column-date/m-p/1383785#M807999</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Felipe,&lt;/P&gt;&lt;P&gt;Maybe a subroutine like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sub LoadTable(DB,SourceTableName)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;TRACE;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;TRACE FROM&amp;nbsp;&amp;nbsp; $(DB);&lt;/P&gt;&lt;P&gt;TRACE;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;'$(&lt;SPAN style="font-size: 13.3333px;"&gt;SourceTableName&lt;/SPAN&gt;)'&lt;/SPAN&gt;:&lt;/P&gt;&lt;P&gt; LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp; FIELD1 AS FieldName1,&lt;/P&gt;&lt;P&gt;&amp;nbsp; FIELD2 AS FieldName2,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '$(DB)' AS Source&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;SQL SELECT&lt;/P&gt;&lt;P&gt;FIELD1,&lt;/P&gt;&lt;P&gt;FIELD2,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .&lt;/P&gt;&lt;P&gt;&amp;nbsp; FROM&amp;nbsp;&amp;nbsp; $(DB).SYSADM.$(&lt;SPAN style="font-size: 13.3333px;"&gt;SourceTableName&lt;/SPAN&gt;); *you may need to amend this line to suit your system&lt;/P&gt;&lt;P&gt; End Sub;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can add more arguments if you like. Maybe an argument to give the resident table a name different from the source name or parameters you can put in a WHERE clause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To concatenate just call the subroutine with different arguments&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Call LoadTable('DW201501','XXXX');&lt;/P&gt;&lt;P&gt;Call LoadTable('DW201502','XXXX');&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&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;Andrew&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Oct 2017 07:32:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Select-the-db-based-on-the-column-date/m-p/1383785#M807999</guid>
      <dc:creator>effinty2112</dc:creator>
      <dc:date>2017-10-18T07:32:34Z</dc:date>
    </item>
  </channel>
</rss>

