Qlikview: how do I join ODBC loaded data with excel loaded data? [closed] - qlikview

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
I seem to not be able to insert ODBC data onto a resident loaded table.
What is the correct way to add/append data onto a resident loaded table?
Any help appreciated.
***I've tried loading dimensions from ODBC with resident load, however I would normally get an error that those values do not exist.

If the 2 tables have exactly the same column names then QlikView will automatically concatenate them. i.e. append the one onto the other.
Try this;
ODBC_TABLE:
sql select A,
B,
C
from DB_TABLE_NAME;
load A,
B,
C
from EXCEL.XLS;
This will result in one table called ODBC_TABLE with columns A, B and C containing the data from both sources.
Or if you need extra columns from one of the tables you can force the 2 together using the concatenate() load prefix for the second table you load
ODBC_TABLE:
sql select A,
B,
C
from DB_TABLE_NAME;
concatenate(ODBC_TABLE)
load A,
B,
C,
D
from EXCEL.XLS;
Resulting in one table called ODBC_TABLE with columns A, B, C and D containing all the data from the 2 sources and nulls in D for records from the first source

Related

Remove sorting order differences while comparing 2 tables using sql [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 days ago.
Improve this question
I am trying to compare cell to cell of 2 tables.
There is a situation wherein a record in column C is in row 4 of table 1 while same record is in row 7 in table 2.
Hence during comparison, record in col C and row 4 is giving a mismatch as it's not same in table 2.
In reality, such mismatches are to be ignored since it exists somewhere within table 2 but just in different row.
What is the best way to ignore such mismatches.
I am not able to get with Exist function syntax.
For example record in tbl1."Col C" is to be seen if available in tbl2."Col C" and if this record is not found, then the mismatch has to be reported.
I am not able to get right syntax here either for exist function or sorting 2 tables and then comparing.

On a table R(ABCDE) like that, i need a SQL Trigger that prevents when tuple's A and B columns are same but try to give a different value to C

On the R(ABCDE) table tuples if A and B are same, then C also same value. I need a trigger that prevents to violate this rule when update the table.
This is too long for a comment.
This question indicates a short-coming in the data model. If C is dependent on A and B, it should have its own table. I think the data model needs to be fixed.
You should have an AB table:
AB_ID A B C
In this table the combination A/B would be unique.
Your table would then remove the three columns A, B, and C and replace them with AB_ID.
Voila! You can model the data correctly and you don't need to use a trigger.

Efficeint way to check if 35K + rows are present in table X having 700000+ rows? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I have 35K+ records (say column A) in a flat file. I have to check if these records are already present in table X (having 700000+ records)
Column A is not an Indexed column in Table X. I do not have any column in Flat File which is indexed in X.
-I can't use the IN operator in SELECT because it is not a feasible option for 35+ records ( costly and limit being 1K)
- All the records have a similar pattern so I tried pattern match using LIKE operator in SELECT but it is very inefficient. ( the number of records with similar pattern in X is 120000+)
- I do not have create table privilege to insert in new table and subtract etc.
I am new to Oracle sorry if this question is naive. Also, I searched for similar questions and could not find answers for non-indexed columns.
Could someone please help me?
Flat file means text file like CSV or TSV? If it's just a text file, load it into database. Perhaps you can create a temporary table for this job. Then you can use the following query:
select *
from x
where (c1, c2, ...) in (select c1, c2, ... from a);

Best Strategy to Copy delta from one database to another [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I have a Transaction Database TD with Table A.
I have another Reporting Database RD with Table B.
Table B is exactly similar to table A in terms of Columns & Datatypes.
I need to copy Table A into Table B :
Specifics about Table A :
1)Table A is a transaction table and there are new transactions added everyday into it.
2)Also Table A has updates to existing transactions every day, there is a column called updateddate which is updated in case there are any updates on the transaction.
Method I am following :
I created an SSIS package to copy the data from Transaction Database to Reporting
Database the first time, In table B I created a new column called RDUpdateddate to insert the time each record was updated.
I created another SSIS package which I set up as a SqlServerJob running everynight.
It gets all the transactions that were run after the RDUpdateddate and copys them
to a staging table. Then I use a stored procedure to insert and update my table B.
Although this method works.I would like to know if there is a more efficient way of doing everything in the SSIS package itself
What I normally do for this cases is something like this:
If I understand well what you're doing, you can't identify if a register change without using the field RDUpdateddate that you created in Table B, if you want to change that, but I really don't think is good idea, you can use a hash field in each table, just add it the the query not fisically in the table, it must be updated each time you execute the package.
After that is the join having as left table the Table A to obtain if the register is new or old, you identify that by using one field of Table B, if the field is null is beacuse it doesn't exist.
In the conditional split you should use the column of the Table B to know if is knew, and your're prefered method to update if it already exists.
Edit:
To be able to compare the two tables you can create a query like this in Table A:
SELECT id, field1, field2, CHECKSUM(field1, field2) HASH_TOTAL FROM Table_A
And a query like this in Table B:
SELECT id, field1, field2, CHECKSUM(field1, field2) HASH_TOTAL FROM Table_B
Then in the Conditional Split you evalute if the values are equal, different or doesn't exist the value in table B.
I hope it helps.

sql insert PROBLEM

I want to get data from one table and transfer it to another like-for-like table on another pc.
Is there a sql command where i can do an "insert into table....."
( but knowing the current values)
Better explaination:
Imagine you have 2 PC's. Both on separate servers. I want to update the information from a table in PC 1 into PC 2. How?
It sounds like you're looking for
INSERT INTO SomeTable(A, B, C)
SELECT A, B, C FROM OtherTable
EDIT: Many database servers allow you to connect to a different server and use its data.
Your question cannot be answered without more detail.
In SQL Server, you can set up a linked server, then write SELECT A, B, C FROM Server2.Database.Schema.OtherTable.