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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
nivedhitha
Creator III
Creator III

Issues implementing scd type 2

Hi,

 

I'm trying to implement scd type 2 without using the dedicated component because of some of its limitation. 

So basically I have to find if the data exists in the target if it does, I update the current flag to 'N' , update the end_ts to the current time and then insert the current record, get the end ts of the last records, increment by 1s and then add it as start_Ts for the current record.

And for the persistent key, any new record gets max(persistent key)+1 but for already existing dimensions, the persistent key should be same as that of the already existing record. I wasn't able to implement this with SCD component so I have to use tmap and lookups to achieve this.

My problem is I can have multiple entries for the same dimension in the source like this0683p000009M7jx.png

 

there are 2 records for the same PKEMPLOYEENO and when this gets processed, the first record should be a new insert but when the 2nd record is looked up, it shouldn't be considered as a new entry and im not able to figure out how to do this.

Can someone pls suggest how I should proceed?
Or if there is a work around with the SCD component , please suggest that too

 

Thanks in advance

 

Labels (1)
  • Cloud

1 Reply
brama
Contributor III
Contributor III

Hi,
Whenever you're looking up you should pull the data with current flag=y. So always only one record will come from reference/target. When you do the lookup based on the key PKEMPLYEENOO you will get this record in output as update record (match if you did inner join and tmap) and rejects will be your insert. As you got the result as match you have to send this to update link. In dimensions always you get same primary keys from source with change in value columns and is expected.
Thanks,
Ramachandran B