Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Text manipulation

I have a table called Inventory Master, within this table there is a column called 12 month usage. The problem I am having is that the 12 month usage column combines all 12 months separated by a space. I need to be able to break the data up into separate columns so I can show each month in it's own field. Any input or assistance would be greatly appreciated.

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Perhaps you can use the subfield function:

LOAD

     ...some fields...,

     SubField([12 month usage], ' ') as [month usage],

     ...some more fields...

FROM

     ....source....

     ;

Or

LOAD

     ...some fields...,

     SubField([12 month usage], ' ',1 ) as [month usage 1],

     SubField([12 month usage], ' ',2 ) as [month usage 2],

     ....etc

     SubField([12 month usage], ' ',12 ) as [month usage 12],

     ...some more fields...

FROM

     ....source....

     ;


talk is cheap, supply exceeds demand

View solution in original post

3 Replies
Gysbert_Wassenaar

Perhaps you can use the subfield function:

LOAD

     ...some fields...,

     SubField([12 month usage], ' ') as [month usage],

     ...some more fields...

FROM

     ....source....

     ;

Or

LOAD

     ...some fields...,

     SubField([12 month usage], ' ',1 ) as [month usage 1],

     SubField([12 month usage], ' ',2 ) as [month usage 2],

     ....etc

     SubField([12 month usage], ' ',12 ) as [month usage 12],

     ...some more fields...

FROM

     ....source....

     ;


talk is cheap, supply exceeds demand
Not applicable
Author

Hey Robert,

As Gysbert mentioned SUBFIELD is an answer here.

If I can suggest something: - If you are planning to create charts using this dataset, consider using The Crosstable Load on top of data generated by Gysbert's script. Having all months as one dimension will make your life much easier

BR,

Kuba

Not applicable
Author

Worked like a charm. Thank you.

Robert Galloni

Information Technology Director