I am implementating SCD type2 without using SCD component in talend but i am not getting Startdate and End as par my requirement.
1.If data is fresh then start date will set as current date and end date as null.
2.if data is already exist in DB but one attribute changed that data then what it should do for previous record end date should be as current date and for new updated record start date as current date and end date will be null.
Please Tell me where m going wrong.
Here my screenshots:
You shouldn't need 2 subjobs. Why not just have 1 subjob with your new data feeding your tMap as Main and your existing data (in the scd) as your lookup. Join on whatever key you use. When there is a join, you need to update your existing record (use an output to update this record setting the end date as the date of the new record. You also have an output for your new record (where you will set the start date as the same date as the end date of the updated record). If there is no join, you only send the new record.
Thanks for your response, I go through the your previous comment and implement but i am getting Variable error.
Below is snapshot:
Hera are all details:
Please tell me if i am using wrong expression as well and putting condition in expression builder box for update and old record.
ok i am fix the variable problem but now job looks like stuck cause condition and expression.
can anyone have look on this:
these are snapshots for insert, update and old dim_table, check if action on data option:
Your tMap should be checking if row7 data is null. The userId from row6 will not be null.....because that is Main data. You need to check the lookup data for nulls. If you get an error saying that int cannot be null, that is true. Just tick the "Nullable" tick box for that column in the schema and it will change it to an Integer. An int is primitive and can never be null. An Integer is a class and can be null.
can you just clarify me which type expression i ll write for :
insert new record