Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Splitting the columns by Position and Length

I have a file that needs to be parsed by position and lenght of text split into columns 

           AT DATE 20-02-2020
18:00 045987 $30 56798 TRANS_SUCCESS
18:20 042397 $10.20 56798 TRANS_SUCCESS
               AT DATE 25-03-2020
18:10 045987 $13 56794 TRANS_SUCCESS
18:20 042397 $11.20 56791 TRANS_SUCCESS

 

Following are the Spec

  Header :

   AT DATE - Position 20 length 08 , Date (20-02-2020,25-03-2020) Positon :25, length 10

 Details :

   Time (18:00,18:20,18:10,18:20) - Positon 5 Length 5,

   tranactionID(045987,042397,..) :Position 12 length 7,

    Amount ($30,$10,$13 etc) :Postion 21 length 3 ,

    Receipt ID (56794,56791 etc) Postition 24, length 5

 

Can I split the column by position and length using one Column Splitter . 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

I solved it by using ...

 

Splitter.SplitTextByRanges({{25,10},{5,5},{12,7},{21,3},{24,5}},false), {"AT DATE", "Time","TransactionID","Amount","Receipt"})

 

Thanks 

View solution in original post

1 REPLY 1
Anonymous
Not applicable

I solved it by using ...

 

Splitter.SplitTextByRanges({{25,10},{5,5},{12,7},{21,3},{24,5}},false), {"AT DATE", "Time","TransactionID","Amount","Receipt"})

 

Thanks 

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

Top Solution Authors
Top Kudoed Authors