Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
zwyne
Creator
Creator

Separate Number and Text

Hello Experts,

PFA

In attached file I have column called Value Local Currency which is a mixed column. So I am trying to separate value and text but I am getting wrong results. I have used the following statement as below:

KeepChar([Value Local Currency],'0123456789') AS number,
PurgeChar([Value Local Currency],'0123456789') AS text

Please assist.

Thanks

Labels (1)
1 Solution

Accepted Solutions
surendraj
Specialist
Specialist

Simply You can

subfield([Value Local Currency],' ',1) as Number

subfield([Value Local Currency],' ',2) as Text

View solution in original post

5 Replies
avkeep01
Partner - Specialist
Partner - Specialist

Hi Bafana,

Try SUBFIELD([Value Local Currency],' ZAR',1) AS Value

That will retrevie the part before " ZAR", which is the value.

tunoi
Creator
Creator

try these:

right([Value Local Currency],len([Value Local Currency]) - index([Value Local Currency], ' ')) as Currency

and

num(left([Value Local Currency],index([Value Local Currency], ' '))) as [Expected Value]

neelamsaroha157
Specialist II
Specialist II

Hi Bafana,

Check this out.

Let me know if you find it helpful.

Thanks

surendraj
Specialist
Specialist

Simply You can

subfield([Value Local Currency],' ',1) as Number

subfield([Value Local Currency],' ',2) as Text

zwyne
Creator
Creator
Author

Thank you everyone for the assistance.