cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
nagestiada
Post Partisan
Post Partisan

Split string to a collection

Hello guys,

I have multiple columns that has delimeter and I want it to split into a collection as a text but not sure on how to do it

 

Here is my DIDList

RTIDDID
1234:5123:49121:2:3
9243:2941:49381:2:3
19231

 

My local collection output should be

RTIDDID
12341
51232
49123
92431
29412
49383
19231
1 ACCEPTED SOLUTION

Accepted Solutions
v-bofeng-msft
Community Support
Community Support

Hi @nagestiada ,

 

I've made a test for your reference:

1\Create a DIDList

vbofengmsft_0-1670900894034.png

2\Split the collection by this code

 

Ungroup(
ForAll(
    DIDList,
    ForAll(
        Sequence(CountRows(Split(RTID,":")),1,1),
        {RTID:Last(FirstN(Split(RTID,":"),Value)).Result,DID:Last(FirstN(Split(DID,":"),Value)).Result}
    )
),"Value")

vbofengmsft_1-1670900962698.png

 

 

 

Best Regards,

Bof

View solution in original post

2 REPLIES 2
v-bofeng-msft
Community Support
Community Support

Hi @nagestiada ,

 

I've made a test for your reference:

1\Create a DIDList

vbofengmsft_0-1670900894034.png

2\Split the collection by this code

 

Ungroup(
ForAll(
    DIDList,
    ForAll(
        Sequence(CountRows(Split(RTID,":")),1,1),
        {RTID:Last(FirstN(Split(RTID,":"),Value)).Result,DID:Last(FirstN(Split(DID,":"),Value)).Result}
    )
),"Value")

vbofengmsft_1-1670900962698.png

 

 

 

Best Regards,

Bof

@v-bofeng-msft Hello,

Sorry what if I have 3 columns instead of 2 that has the same properties but different value.

Helpful resources

Top Solution Authors
Top Kudoed Authors
Users online (4,358)