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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
lmit
Creator II
Creator II

Scd type 2 without using component

Hi all,

How can I implement scd type 2 without using scd type 2 components?

For sample
Id,name,course,key
1,xxx,jjj,k1
2,yyy,KKK,k2

For first load data will be loaded as its is.for second load if data is like below
Id,name,course,key
1,ccc,jjj,
3,ddd,lll

My output should be

Id,name,course,key
1,xxx,jjj,n
2,yyy,KKK,k2
1,ccc,jjj,y

The key column for old record should change to n and new one should be y

Any help would be helpful.

Thanks in advance,
Lmit
Labels (2)
24 Replies
Anonymous
Not applicable

@lmit Thanks Lmit for your renspose sure it will help me if you will show variable expression so that it will easy for me to write expression.

Anonymous
Not applicable


Thanks Lmit

which type of flag you used in implementation? Can you please explain me more so that it can help me.
Anonymous
Not applicable

If you don't mind can you send me screenshot of tmap.
Anonymous
Not applicable

(row1.column!= null)? 1:0

gettting error on this:

the operator != is undefined for the argument type(s) int

0683p000009Lt9j.png

lmit
Creator II
Creator II
Author

If am not wrong you are asking about local variables.
See the scd2_step2.jpg for the variable logic below the screenshot I have mentioned.

Thanks,
Lmit
lmit
Creator II
Creator II
Author

Hi arpit, 

 

are you able to implement SCD type2  or need more information?

 

Thanks,

lmit

Anonymous
Not applicable

Hi Lmit,

Thanks a lot for response. I am still not able to implement SCD type getting error on variable and condition, could you please help me in variables?

0683p000009LtK7.pngThanks,

Arpit

lmit
Creator II
Creator II
Author

Hi Arpit,

 

Can you please provide more information about error like on which columns you applied the condition and the datatypes?

 

Thanks,

lmit

lmit
Creator II
Creator II
Author

i think your userId column is int datatype that's why its not taking considering !=

 

scd2_Step2.jpg in the Zip file which i send has the logic for the Variables.

 

Thanks,

lmit

Anonymous
Not applicable

Hi lmit,

 

Here are tables details

source

0683p000009LtKV.png

 

target

0683p000009LtKa.png

s_key is auto generated key and userid is primarykey.

 

Thanks,

Arpit