Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Tee_dubs
Contributor III
Contributor III

String to a series of columns

I have a data source where a field has text Data that I need to extract into a series of new columns based on certain conditions.

The data in the feilds looks like this:

1000 HR  100 TO

500 TO 1000HR 5YR

12YR/ 500TO/NOTE

as you can see there is not a consistent format.

One thing that is consistent is it is always a Value followed by a unit of measurement.

My idea is to purge all chars except letters or numbers.

I then need to extract the number into a value A column and the corresponding measurement value into Measurement A column and so on for Value B,C and D.

Once this is done i need to do some nested if conditions to transfer all of the values into yet another set of columns for each Measurement.

Im struggling in where to begin. 

I can provide more info if required

Labels (1)
2 Replies
Shubham_Deshmukh
Specialist
Specialist

can u post exact expected output in column ?
Tee_dubs
Contributor III
Contributor III
Author

The final result should be:

YR (int)      HR (int)      TO (int)       NOTE (boolean)
                    1000           100              0
5                 1000            500              0
12               500                                  1