<?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 Merge two database into one in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Merge-two-database-into-one/m-p/1602672#M736863</link>
    <description>&lt;P&gt;Dear All,&lt;/P&gt;&lt;P&gt;I have a following query:-&lt;/P&gt;&lt;P&gt;I was having two database in which table name was same in both the database&amp;nbsp;&lt;/P&gt;&lt;P&gt;so from back-end&amp;nbsp; the data was merged(and IP address was changed in qlikview as well) into one and each tables were having following conditions applied&lt;/P&gt;&lt;P&gt;Now I want to apply both the below&amp;nbsp; conditions(marked in red colour)&amp;nbsp; in one table only(NEW TABLE ONLY). how to do the same ?&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Table 1 with old database&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;OLEDB CONNECT TO [Provider=SQLOLEDB.1;Persist Security Info=True;User ID=qlikview;Initial Catalog=BIORAD_QCDAO;Data Source=111.111.1111.36;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=QVNRL-SRV-POC;Use Encryption for Data=False;Tag with column collation when possible=False] (XPassword is aKeddYRNJbaMXUVMXDQCDZMGTD);(old database connection)&lt;BR /&gt;Concatenate($(vTableName))&lt;BR /&gt;LOAD *,&lt;BR /&gt;&amp;nbsp;&lt;FONT color="#FF6600"&gt;Mid(LABNAME,1,index(LABNAME,'-',1)-1) as Lab_Code,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;&amp;nbsp;Mid(LABNAME,index(LABNAME,'-',1)+1,index(LABNAME,'-',2)-index(LABNAME,'-',1)-1) as Lab_Location,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;Mid(LABNAME, index(LABNAME,'-',2)+1, Len(LABNAME)-index(LABNAME,'-',2)) as Lab_Zone;&lt;/FONT&gt;&lt;BR /&gt;SQL SELECT ANALYTE,&lt;BR /&gt;CITY,&lt;BR /&gt;Comment,&lt;BR /&gt;CorrectiveAction,&lt;BR /&gt;&amp;nbsp;ExpiredDate,&lt;BR /&gt;&amp;nbsp;FixedCV,&lt;BR /&gt;&amp;nbsp;FixedMean,&lt;BR /&gt;&amp;nbsp;FixedSD,&lt;BR /&gt;&amp;nbsp;INSTRUMENT,&lt;BR /&gt;LABID,&lt;BR /&gt;LABNAME,&lt;/P&gt;&lt;P&gt;&amp;nbsp;LevelName,&lt;BR /&gt;&amp;nbsp;LevelValue,&lt;BR /&gt;LOT_NAME,&lt;BR /&gt;&amp;nbsp;LOT_NO,&lt;BR /&gt;&amp;nbsp;Operator,&lt;BR /&gt;&amp;nbsp;Status,&lt;BR /&gt;TEST_DATE,&lt;BR /&gt;&amp;nbsp;WestgardRuleViolation,&lt;BR /&gt;ZScore,&lt;BR /&gt;Matrix,&lt;BR /&gt;REAGENT,&lt;BR /&gt;UNIT,&lt;BR /&gt;TEMPERATURE&lt;BR /&gt;FROM "BIORAD".dbo."DASHBOARD";&lt;/P&gt;&lt;P&gt;STORE $(vTableName) into $(vQvdPathStage1)$(vTableName).qvd(qvd);&lt;/P&gt;&lt;P&gt;DROP Table $(vTableName);&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;NEW table&amp;nbsp; new connection string&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;$(vTableName):&lt;BR /&gt;LOAD *,&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;if(LABID = '166051','S03',&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;&amp;nbsp;if(Match(LABID,'180128','180130','180132','180138','180140','180142','180144','180148','180150','180152','180154','180156','180163'), 'L51','LPL')) as Lab_Code,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;&amp;nbsp;if(LABID = '166051','Preet Vihar',&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;if(Match(LABID,'180128','180130','180132','180138','180140','180142','180144','180148','180150','180152','180154','180156','180163'),'KRL','NRL')) as Lab_Location,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;if(LABID = '166051','DNCR',&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;if(Match(LABID,'180128','180130','180132','180138','180140','180142','180144','180148','180150','180152','180154','180156','180163'),'KRL','NRL')) as Lab_Zone;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;SQL SELECT ANALYTE,&lt;BR /&gt;&amp;nbsp;CITY,&lt;BR /&gt;Comment,&lt;BR /&gt;CorrectiveAction,&lt;BR /&gt;ExpiredDate,&lt;BR /&gt;FixedCV,&lt;BR /&gt;&amp;nbsp;FixedMean,&lt;BR /&gt;&amp;nbsp;FixedSD,&lt;BR /&gt;INSTRUMENT,&lt;BR /&gt;&amp;nbsp;LABID,&lt;BR /&gt;&amp;nbsp;LABNAME,&lt;BR /&gt;&amp;nbsp;LevelName,&lt;BR /&gt;LevelValue,&lt;BR /&gt;&amp;nbsp;LOT_NAME,&lt;BR /&gt;LOT_NO,&lt;BR /&gt;&amp;nbsp;Operator,&lt;BR /&gt;Status,&lt;BR /&gt;TEST_DATE,&lt;BR /&gt;&amp;nbsp;WestgardRuleViolation,&lt;BR /&gt;&amp;nbsp;ZScore,&lt;BR /&gt;&amp;nbsp;Matrix,&lt;BR /&gt;REAGENT,&lt;BR /&gt;UNIT,&lt;BR /&gt;TEMPERATURE&lt;BR /&gt;&lt;BR /&gt;FROM "BIORAD_QCDAO".dbo."DASHBOARD";&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
    <dc:creator>sakshikaul</dc:creator>
    <dc:date>2020-11-25T16:16:04Z</dc:date>
    <item>
      <title>Merge two database into one</title>
      <link>https://community.qlik.com/t5/QlikView/Merge-two-database-into-one/m-p/1602672#M736863</link>
      <description>&lt;P&gt;Dear All,&lt;/P&gt;&lt;P&gt;I have a following query:-&lt;/P&gt;&lt;P&gt;I was having two database in which table name was same in both the database&amp;nbsp;&lt;/P&gt;&lt;P&gt;so from back-end&amp;nbsp; the data was merged(and IP address was changed in qlikview as well) into one and each tables were having following conditions applied&lt;/P&gt;&lt;P&gt;Now I want to apply both the below&amp;nbsp; conditions(marked in red colour)&amp;nbsp; in one table only(NEW TABLE ONLY). how to do the same ?&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Table 1 with old database&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;OLEDB CONNECT TO [Provider=SQLOLEDB.1;Persist Security Info=True;User ID=qlikview;Initial Catalog=BIORAD_QCDAO;Data Source=111.111.1111.36;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=QVNRL-SRV-POC;Use Encryption for Data=False;Tag with column collation when possible=False] (XPassword is aKeddYRNJbaMXUVMXDQCDZMGTD);(old database connection)&lt;BR /&gt;Concatenate($(vTableName))&lt;BR /&gt;LOAD *,&lt;BR /&gt;&amp;nbsp;&lt;FONT color="#FF6600"&gt;Mid(LABNAME,1,index(LABNAME,'-',1)-1) as Lab_Code,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;&amp;nbsp;Mid(LABNAME,index(LABNAME,'-',1)+1,index(LABNAME,'-',2)-index(LABNAME,'-',1)-1) as Lab_Location,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;Mid(LABNAME, index(LABNAME,'-',2)+1, Len(LABNAME)-index(LABNAME,'-',2)) as Lab_Zone;&lt;/FONT&gt;&lt;BR /&gt;SQL SELECT ANALYTE,&lt;BR /&gt;CITY,&lt;BR /&gt;Comment,&lt;BR /&gt;CorrectiveAction,&lt;BR /&gt;&amp;nbsp;ExpiredDate,&lt;BR /&gt;&amp;nbsp;FixedCV,&lt;BR /&gt;&amp;nbsp;FixedMean,&lt;BR /&gt;&amp;nbsp;FixedSD,&lt;BR /&gt;&amp;nbsp;INSTRUMENT,&lt;BR /&gt;LABID,&lt;BR /&gt;LABNAME,&lt;/P&gt;&lt;P&gt;&amp;nbsp;LevelName,&lt;BR /&gt;&amp;nbsp;LevelValue,&lt;BR /&gt;LOT_NAME,&lt;BR /&gt;&amp;nbsp;LOT_NO,&lt;BR /&gt;&amp;nbsp;Operator,&lt;BR /&gt;&amp;nbsp;Status,&lt;BR /&gt;TEST_DATE,&lt;BR /&gt;&amp;nbsp;WestgardRuleViolation,&lt;BR /&gt;ZScore,&lt;BR /&gt;Matrix,&lt;BR /&gt;REAGENT,&lt;BR /&gt;UNIT,&lt;BR /&gt;TEMPERATURE&lt;BR /&gt;FROM "BIORAD".dbo."DASHBOARD";&lt;/P&gt;&lt;P&gt;STORE $(vTableName) into $(vQvdPathStage1)$(vTableName).qvd(qvd);&lt;/P&gt;&lt;P&gt;DROP Table $(vTableName);&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;NEW table&amp;nbsp; new connection string&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;$(vTableName):&lt;BR /&gt;LOAD *,&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;if(LABID = '166051','S03',&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;&amp;nbsp;if(Match(LABID,'180128','180130','180132','180138','180140','180142','180144','180148','180150','180152','180154','180156','180163'), 'L51','LPL')) as Lab_Code,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;&amp;nbsp;if(LABID = '166051','Preet Vihar',&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;if(Match(LABID,'180128','180130','180132','180138','180140','180142','180144','180148','180150','180152','180154','180156','180163'),'KRL','NRL')) as Lab_Location,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;if(LABID = '166051','DNCR',&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;if(Match(LABID,'180128','180130','180132','180138','180140','180142','180144','180148','180150','180152','180154','180156','180163'),'KRL','NRL')) as Lab_Zone;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;SQL SELECT ANALYTE,&lt;BR /&gt;&amp;nbsp;CITY,&lt;BR /&gt;Comment,&lt;BR /&gt;CorrectiveAction,&lt;BR /&gt;ExpiredDate,&lt;BR /&gt;FixedCV,&lt;BR /&gt;&amp;nbsp;FixedMean,&lt;BR /&gt;&amp;nbsp;FixedSD,&lt;BR /&gt;INSTRUMENT,&lt;BR /&gt;&amp;nbsp;LABID,&lt;BR /&gt;&amp;nbsp;LABNAME,&lt;BR /&gt;&amp;nbsp;LevelName,&lt;BR /&gt;LevelValue,&lt;BR /&gt;&amp;nbsp;LOT_NAME,&lt;BR /&gt;LOT_NO,&lt;BR /&gt;&amp;nbsp;Operator,&lt;BR /&gt;Status,&lt;BR /&gt;TEST_DATE,&lt;BR /&gt;&amp;nbsp;WestgardRuleViolation,&lt;BR /&gt;&amp;nbsp;ZScore,&lt;BR /&gt;&amp;nbsp;Matrix,&lt;BR /&gt;REAGENT,&lt;BR /&gt;UNIT,&lt;BR /&gt;TEMPERATURE&lt;BR /&gt;&lt;BR /&gt;FROM "BIORAD_QCDAO".dbo."DASHBOARD";&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Merge-two-database-into-one/m-p/1602672#M736863</guid>
      <dc:creator>sakshikaul</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Merge two database into one</title>
      <link>https://community.qlik.com/t5/QlikView/Merge-two-database-into-one/m-p/1603823#M736864</link>
      <description>&lt;P&gt;Probably the easiest way to do this is to first concatenate the two tables, with no conditions applied.&amp;nbsp; then reload the newly concatenated table using a resident load, and apply your conditions, then Drop the original table.&amp;nbsp; I uploaded a text file with what the script might look like.&amp;nbsp; My SQL skills are pretty rusty, so you will need to clean that up, but you should get the idea.&lt;/P&gt;&lt;P&gt;Also, you will probably need to qualify the field names.&amp;nbsp; I have run into versions of Qlik where the Drop Table will drop all the fields that are named the same.&amp;nbsp; so if you don't changed the names in your Temp table, to be different from the Field names in your New Table, the Dop Table statement may also drop the fields in your New Table, inadvertently.&amp;nbsp; Just something to be aware of.&lt;/P&gt;&lt;P&gt;Good luck,&lt;/P&gt;&lt;P&gt;Nate&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2019 16:40:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Merge-two-database-into-one/m-p/1603823#M736864</guid>
      <dc:creator>hallquist_nate</dc:creator>
      <dc:date>2019-07-18T16:40:35Z</dc:date>
    </item>
    <item>
      <title>Re: Merge two database into one</title>
      <link>https://community.qlik.com/t5/QlikView/Merge-two-database-into-one/m-p/1610794#M736865</link>
      <description>&lt;P&gt;Did Nate's post help you resolve things?&amp;nbsp; If so, please be sure to give credit by clicking the Accept as Solution on the post.&amp;nbsp; If you are still struggling, leave an update, and if you used a different solution, it would be great if you could post that for others, so they may learn from it too.&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt;Brett&lt;/P&gt;</description>
      <pubDate>Thu, 08 Aug 2019 16:05:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Merge-two-database-into-one/m-p/1610794#M736865</guid>
      <dc:creator>Brett_Bleess</dc:creator>
      <dc:date>2019-08-08T16:05:04Z</dc:date>
    </item>
  </channel>
</rss>

