Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to get start date for new record and set end date for previous record

Hi All,

 

I am implementating SCD type2 without using SCD component in talend but i am not getting Startdate and End as par my requirement.

Requirement is:

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.0683p000009LtGk.png0683p000009LtOm.png0683p000009LtOr.png0683p000009LtH6.png

Please Tell me where m going wrong.

 

Thanks,
Arpit

Here my screenshots:

Labels (2)
20 Replies
Anonymous
Not applicable
Author

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.

Anonymous
Not applicable
Author

still its not giving me any result. 0683p000009LswP.png

Anonymous
Not applicable
Author

You're still checking for 0 instead of null. row7 values will be null if there is no join

Anonymous
Not applicable
Author

If i am putting Null then it will give me error0683p000009LtPB.png

Anonymous
Not applicable
Author

You need to ensure your userId column is set to Nullable for row7.  

Anonymous
Not applicable
Author

Please have a look on this

0683p000009LtPQ.png

Anonymous
Not applicable
Author

If you are still getting a compilation error you need to take another look at the Code tab to look for errors. Take a screenshot of the errors

Anonymous
Not applicable
Author

still getting error on typemismatch0683p000009Lt5m.png0683p000009LsU3.png

Anonymous
Not applicable
Author

It looks like you have changed the job and the filtering for your tMap outputs. It says you are mixing int with booleans in the error message.

Anonymous
Not applicable
Author

can you just clarify me which type expression i ll write for :

insert new record

updated record

inactive record