Compare Keys in Informatica - informatica

I am trying to solve an Informatica problem
I have two tables: Table A and Table B have the following structure
Table A
A_Key
A_Name
A_Address
Table B
B_Key
B_Name
B_Address
A_Key (Foreign Key)
I need to make sure that Every A_Key in Table B exist as A_Key in Table A.
Since I am new to Informatica Data Quality tool, I am trying to find the logic how I can implement this.
One logic that I can think is creating Rule
Does anyone have a better solution?

You can implement a joiner between Table B (as master) and Table A (as detail), the joiner type must be detail outer, so you will get all rows in table B and their equivalent in table A. Then you could obtain those rows in table B wich doesn't have an equivalent in Table A using a filter transformation. And finally you can count the rows using an aggreation transformation.
Table A
Joiner A-B --- Filter (a is null) -- Agregator (count rows)
Table B

Related

Does using fact tblname in all DAX fucntions result in table expansion?

Given a model with fact table having multiple dimension tables, Does using the fact tblname in all DAX fucntions result in table expansion?
Example:
SUMX(tblname, expr)
CALCULATE(expr, FILTER(tblname, criteria))
Yes, when a relationship exists, there is an expanded table.
In the first example
SUMX(tblname, expr)
the iterator creates a row context over the tablname. RELATED must be used to access fields in the tblname expanded tables that are not parte of tablename, but reachable through a many to one relationship.
in the second example
CALCULATE(expr, FILTER(tblname, criteria))
the FILTER is an iterator and therefore it works like in the first example.
The table returned by FILTER inside CALCULATE acts as an expanded table, therefore affecting not only the existing filters over tblname, but also the existing filters over the columns that are part of the tblname expanded table.
For instance, assuming to have a model with a table Customers and a table Sales with a one to many relationship between Customers and Sales, in this code
CALCULATE([Sales Amount], FILTER(ALL(Sales), Sales[Quantity] > 2))
the FILTER returns a filtered Sales expanded table that removes any existing filter over Customers table.

Teradata update target table with source table with multiple ID instances with different dates

I have two tables A and B.
Table A has has fields such as ID,DATE,AMOUNT etc. ID field has id numbers spanning from 10-15 digit numbers. Some of the numbers are 1 to 4 digit in length and we need to get full digit for these sets. There is another table B that has a ID number details and matches with partial Ids in table A. I need to update table A partial ID with full ID from table B where only few numbers match.
I attempted the following and keep getting an error, please help.
Update A
FROM tablenamexyz a,
(select distinct a.ID1,b.ID,date
FROM TABLE tablenamexyz a,
tablenamebty b
where a.ID1=RIGHT(b.ID,4)
QUALIFY ROW_NUMBER(OVER(PARTITION BY b.ID ORDER BY date DESC)=1)z
SET a.ID=b.ID
where a.ID1=b.ID1
--I keep getting update failed error-7547, Target row update by multiple source rows. You can see in table B, we can just use one source with the latest date. Please help. Thanks in advance.
No need to include table A in your derived table Z, but you do need to partition by the value you are going to use in the JOIN (ID1 not ID) for uniqueness:
Update A
FROM tablenamexyz a,
(select RIGHT(b.ID,4) as ID_4,b.ID,"date"
FROM tablenamebty b
QUALIFY ROW_NUMBER()OVER(PARTITION BY ID_4 ORDER BY "date" DESC)=1)z
SET a.ID=z.ID
where a.ID1=z.ID_4
Note that date is a reserved word so if that's really your column name you should quote it.

Primary Key and Index

Table Schema
Columns: A, B, C, D, E
I have a primary key in the table which combines (A, B) and I have a query -> Select all from the table whose A = 123.
So the above query will scan the whole table or not? If it will scan the table then the only solution is to create an index over a column A
It WILL try to seek and not scan (a seek is more efficient).
Note that the search terms must be "seekable". Equality is seekable (so you are OK) but, for example, LIKE "%foo%" is not seekable.

Informatica : something like CDC without adding any column in target table

I have a source table named A in oracle.
Initially Table A is loaded(copied) into table B
next I operate DML on Table A like Insert , Delete , Update .
How do we reflect it in table B ?
without creating any extra column in target table.
Time stamp for the row is not available.
I have to compare the rows in source and target
eg : if a row is deleted in source then it should be deleted in target.
if a row is updated then update in target and if not available in source then insert it in the target .
Please help !!
Take A and B as source.
Do a full outer join using a joiner (or if both tables are in the same databse, you can join in Source Qualifier)
In a expression create a flag based on the following scenarios.
A key fields are null => flag='Delete',
B key fields are null => flag='Insert',
Both A and B key fields are present - Compare non-key fields of A and B, if any of the fields are not equal set flag to 'Update' else 'No Change'
Now you can send the records to target(B) after applying the appropriate function using Update Strategy
If you do not want to retain the operations done in target table (as no extra column is allowed), the fastest way would simply be -
1) Truncate B
2) Insert A into B

vaadin: moving data from selected row of table1 to table2

I have two questions:
I have two tables, table1 and table2. I need to design an application in such a way that a selected row of table 1 when clicked should get displayed in table 2.
How do I call a custom table? Suppose I have a class Table with empty constructor and I will pass arguments like Table(pagination). It has to show the table with pagination,
Similarly, Table(lazyloading) has to show lazy loading table. Table(pagination, Lazy loading,search) must show all three properties.
What you have to do for nr 1 is that you attach a Clicklistener to your table1 and on a Clickevent you take the selected Object ni table1 and add it to table2. Also add an if to not add rows that already exist in table 2.
This is how you copy data
public void copydata(){
Object o = table1.getValue();
if(!table2.getItemIds().contains(o))
table2.addItem(o);
table2.setContainerDataSource(table2.getContainerDataSource());
}
When it comes to your second question I have no clue what you are talking about, but I looks like you want to extend the Table class in vaadin to get your own features.