Quantcast
Channel: SQL Server Analysis Services forum
Viewing all articles
Browse latest Browse all 14337

Need to split a unconsistant column into different colmns

$
0
0

Hi,

I have a column with space separated values , my task is to load it into different columns but the thing is they is no consistency in that columns .

Column 

500-02561
500-07275 500-7275 500-A46846 500-G036872 500-AW8222589 500-1528131711

500-100
500-1000 500-A44431 500-G030457 500-AB8788448 500-1770594749

Wanted the output as

col1                     col2              col3                  col4                  col5                       col6

500-02561

500-07275    500-7275    500-A46846     500-G036872   500-AW8222589   500-1528131711

500-100

500-1000     500-A44431 500-G030457   500-AB8788448   500-1770594749.

Tried using derived column 

SUBSTRING(OTHER_NUMBERS_COL,1,(FINDSTRING(OTHER_NUMBERS_COL," ",1)) - 1)

SUBSTRING(OTHER_NUMBERS_COL,(FINDSTRING(OTHER_NUMBERS_COL," ",1) + 1),(FINDSTRING(OTHER_NUMBERS_COL," ",2)) - (FINDSTRING(OTHER_NUMBERS_COL," ",1) + 1)).

I would really appericate if some body could help me out with this :)


Viewing all articles
Browse latest Browse all 14337

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>