Clone detail table and apply condition

Hi there,

Recentely, I am working on a data like below

ID Item DES Price
Test1 A aa 1
A aa 1
A aa 1
B bb 2
B bb 2
C cc 3
C cc 3
D dd 4
D dd 4
Test2 A aa 1
A aa 1
A aa 1
D dd 4
D dd 4

data boundaries set as ID change

I have extracted detail table by using repeat until no more elements

So that for Test1 I have a entire detail[9] table which contains 3A 2B 2C and 2D

Now I need another 4 individual detail table for ABCD only

Is there any way I can duplicate entire details table but with conditions?

at the end
Test1 will have 5 detail tables
entireDetails[9]
ADetails[3]
BDetails[2]
CDetails[2]
DDetails[2]

Test2 will have 5 details tables
entireDetails[5]
ADetails[3]
BDetails[0]
CDetails[0]
DDetails[2]

Many thanks