Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
sangland2
Partner - Creator
Partner - Creator

subfield extract requirement

Hi, Hoping someone has already done this. I have a product file that contains product description which includes text for KW,

eg "SYNERGY 110KW/180A SOFTSTARTER". I want to create a field during load to extract all values as 'KW", eg "110". The KW rating could be anywhere in the description string. Some combination of index and other text field methods locating "KW" then finding the preceeding space, then getting the text between this and KW. Thanks

1 Solution

Accepted Solutions
sangland2
Partner - Creator
Partner - Creator
Author

Thank you both this was very helpful. This combined method works:

If there are multiple spaces before KW, eg

"Some other SYNERGY 110KW/180A SOFTSTARTER"

Load

subfield(Textbetween(ProductDesc,' ','KW'),' ',-1) as KW

- returns just 110

View solution in original post

5 Replies
ali_hijazi
Partner - Master II
Partner - Master II

the following should help:

load textbetween(your_field, ' ', 'KW') as KW

I can walk on water when it freezes
Arthur_Fong
Partner - Specialist III
Partner - Specialist III

Hi Simon,

Refer to attached using subfield for your requirement.

Thanks and regards,

Arthur Fong

sangland2
Partner - Creator
Partner - Creator
Author

Thanks, what if the description was "Some other SYNERGY 110KW/180A SOFTSTARTER",

sangland2
Partner - Creator
Partner - Creator
Author

Thank you both this was very helpful. This combined method works:

If there are multiple spaces before KW, eg

"Some other SYNERGY 110KW/180A SOFTSTARTER"

Load

subfield(Textbetween(ProductDesc,' ','KW'),' ',-1) as KW

- returns just 110

ali_hijazi
Partner - Master II
Partner - Master II

you can benefit from other string functions like:
load mid(ProductDesc,index(ProductDesc,' ',-1) + 1,len(ProductDes) - index(productDes,'KW')-1)

I can walk on water when it freezes