Four Stars

Row Shifting in Detail Transactions for Master Transaction

 

 

I have one Master transaction let say

Key  Details

K1      Acct_Details

 

Now I have 7 detail Transactions

Key  Role       Details

K1   Role1      Addr1

K1   Role2      Addr2

K1   Role3      Addr3

K1   Role4      Addr4

K1   Role5      Addr5

K1   Role6      Addr6

K1   Role7      Addr7

 

Now I want to shift rows. that is Role1 details will move to Role2 details, Role2 details will move to Role3 details.. in this way Role6 details will move to Role7 details. Also no of roles may vary , last one details will be deleted.

 

Please let me know your ideas how can I do this.

2 REPLIES
Twelve Stars TRF
Twelve Stars

Re: Row Shifting in Detail Transactions for Master Transaction

Hi,
Are the role names fixed (role1 to role7)?
Is there always 7 detail rows?
If so, it's possible with a tMap to exclude role7 rows using a filter and to assign a new role to other rows using a distinct sequence for each key.
Here is the tMap:
Capture.PNG
 
As you can see, sequence name is based on the key value so if the flow contains row for key, a new sequence will automatically take place.
This simpe design suppose that rows are sorted by key and role value.
Here is the result for 2 key values (K1 and K2):
Capture.PNG
Is it what you were expected?
Let me know.

TRF
Four Stars

Re: Row Shifting in Detail Transactions for Master Transaction

Thanks for Reply.. But the number of rows are not same all the time .. Max no is 7 .. If 7 does not exists the we can create a new role (Role 7) then we can shift. Also Role1/Role2 may have different Name like 'TSG' or 'TPA'. so Some thing like that..

Input:

K1 TSG             Details1

K1 TPA              Details2

K1 ROLE1         Details3

K1 ROLE2         Details4

K1 ROLE3         Details5

 

Output:

K1 TSG             Details_New

K1 TPA              Details1

K1 ROLE 1        Details2

K1 ROLE2         Details3

K1 ROLE3         Details4

K1 ROLE4         Details5