I have a transformation i am trying to acheive but can’t figure out the logic to do it, can somebody please help me
CLASS is an input, and from it i am removing the last three digs using this code that works well.
" if (right ($in.0. CLASS ,3) == “101”) ($out. 0. IDT_ TYPE = “001”; } else ($out. 0.IDT_TYPE= right ($in. 0.CLASS , 3);}"
in the same transformation, i want to use the 3 digits derived to
"if IDT-Type == ‘001’ then VALUE = 1 AND add 2 more records where all fields except {IDT-TYPE, VALUE} remained unchanged:
If AMOUNT_TO == “”
Create another record and set IDT-TYPE as {“022”, “+” & REPT (“0”, 9 - LEN(FACTOR)) & FACTOR} and VALUE as {“023”, “+999999999000”}
Else
Create another record and set IDT-TYPE as {“022”, “+” & REPT (“0”, 9 - LEN(FACTOR)) & FACTOR} and VALUE as{“023”, “+” & REPT (“0”, 9 - LEN(FACTOR)) & FACTOR & “000”} "
IDT-Type,VALUE,AMOUNT_TO and FACTOR are OUTPUT columns
CLASS is an input column
The most challenging thing for me is how to create a new record (row)