
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Remove part of a string
Hi
I have a addressfield that include specific apartment-ID. I would like to remove the nr/id in the script.
The addresses can look like this.
Mainstreet 43 D lgh 2005 - remove D lgh 2005
Walkingstreet 9 lgh 105 - remove lgh 105
Littlestreet 10a, lgh 100 - remove a, lgh 100
Main littlestreet 240-10 - remove -10
Littlestreeet 52 - don´t remove anything
Little mainstreet 12 - don´t remove anything
Hope you understand, I would like to keep the streetname and streetnr
- Tags:
- new_to_qlikview
- « Previous Replies
-
- 1
- 2
- Next Replies »
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hope that somebody can suggest a simpler way, by then the following works (Assuming, you have three digit street number at max):
Load
Left (Address, RangeMax(findOneOf(Address, '0123456789'), If(FindOneOf(Address, '0123456789' ,2) - FindOneOf(Address, '0123456789') =1, If(FindOneOf(Address,'0123456789', 3) - findOneOf(Address, '0123456789',2)))))
AS NesAddress
From <>;


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
try this


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
PFA qvw that may help
Regards
Alan


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Make use of somthing like this
subfield(FieldName, ' ', 1) & ' ' & subfield(FieldName, ' ', substringcount(FieldName, ' ')) as FieldName
Hope you get the solution


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
use "findoneof(myString, '1234567890')" function to search the first numerical occurrence.
At this point use mid function to extract the substring starting from the first numerical occurrence, take the first n numerical values (you have to check any position in the string - I think no more than 4 digits) and at the end
use left of the original string up to the last numerical position

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Still alphabetic residues at the end of some addresses, Alan.
How about this?
SUBFIELD(Address, ' ', 1) & ' ' & KEEPCHAR(SUBFIELD(SUBFIELD(Address, ' ', 2), '-', 1), '0123456789')

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
you can use a multiple (preceding loads) usage of subfield see attached qvw
Regards
Ton


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry I missed that.
regards
Alan

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please try this:
mid(Address,1,findoneof(Address, '1234567890')-1) & ''& KeepChar(mid(Address,findoneof(Address, '1234567890'),4),'1234567890')
where Address is the Field
Help taken from Alessandro Saccone
Thanks,
Angad


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Use this script (in a text box for instance ...) where myStr is your string
=If(FindOneOf(myStr,'1234567890')>0,
If(IsNum(Mid(myStr,FindOneOf(myStr,'1234567890')+1,1)),
If(IsNum(Mid(myStr,FindOneOf(myStr,'1234567890')+2,1)),
'keep searching'
,Left(myStr,FindOneOf(AAA,'1234567890')+1)
)
,Left(myStr,FindOneOf(myStr,'1234567890'))
)
,myStr
)

- « Previous Replies
-
- 1
- 2
- Next Replies »