Thanks Alecsandra, it works!
- I deleted PERIODID column from Output
- Enhanced only YEAR mapping with || substr(xxx.PERIODID,0,0) (now it looks as follows: substr(xxx.TSTFR,0,4) || substr(xxx.PERIODID,0,0) )
- Changed filter to ignore null and zeros values (xxx.YOUR_KF IS NOT NULL AND cast(xxx.YOUR_KF,'int') > 0 )