Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

duplicate or parse a column with different length characters

I have a column with an assortment of the following example data.   null R266A0744 S2370B1030 S4273A0940   This data represents (Model R,S2,S4)(Julian date 3 char)(Machine 1 char)(Time 4 char...
  • edhans's avatar
    4 years ago

    You would need to write something along the lines of this:

    if Text.Length([data column]) = 9 then Text.Start([data column],1) else Text.Start([data column]2)

    Then do the same fo rthe other 3 parts, but using Text.Middle([data column],2,3) or whatever.

    Just remember in Power Query, it starts counting at 0, so to get the 2nd and 3rd char, it would be Text.Middle([data column], 1, 2) (2nd column, 2 chars)