Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have an input field that users are supposed to input 6 letter/digit code. but users may enter strings with spaces, commas, semicolons, like below:
123456;; , abcdef, 333444 4RTJU8, -->messy, spaces, commas, and semicolon everywhere
how do i transform above string into something like one of following sitution (need to do this on front end)
123456,abcdef,333444,4RTJU8
123456;abcdef;333444;4RTJU8
123456 abcdef 333444 4RTJU8
no comma or semicolon at the end of the string if user entered one.
hopefully there is an esay way to approach this...
HI
Try like this
=PurgeChar('123456 abcdef 333444 4RTJU8','; ,,')
Hope it helps
can you do something more specific??
Suppouse that your field es DATA.
when you load in script you tranforme it.
load
replace(DATA,';','') AS DATA
THEN YOU CAN DO ALL REPLACES THAT YOU WANT.
REPLACE(REPLACE(DATA,';',''),',','')
ETC,
Hope that helps you... regards
but the result will look like this
123456abcdef3334444RTJU8
I want it to look like
123456,abcdef,333444,4RTJU8
or
123456;abcdef;333444;4RTJU8
or
123456 abcdef 333444 4RTJU8
it's an input field, so users will input bad data, I am trying to take that string and do a multiple selection.
try this
=left(PurgeChar('123456 abcdef 333444 4RTJU8','; ,,'),6) &' '& left(right(PurgeChar('123456 abcdef 333444 4RTJU8','; ,,'),18),6)&' '& left(right(PurgeChar('123456 abcdef 333444 4RTJU8','; ,,'),12),6)&' '& left(right(PurgeChar('123456 abcdef 333444 4RTJU8','; ,,'),6),6)
hope that helps you
Hi
Can you pls clarify, for every six character, want to add semicolon?
or something else?
Is the inputfield in the Qlikview document?
If so, there is not a way to validate this the way you want
Check this thread it may help you
because after this
=PurgeChar('123456 abcdef 333444 4RTJU8','; ,,')
I will get a single string '123456abcdef3334444RTJU8' look like this, but i need to have at least one separator in betw the codes, otherwise there is no way i can to do a lookup on them.
i wanted to use input field and select in field in action to do multiple search. i realize if a user entered a string of codes other than 'acceptable format' then the code is not getting selected. that's why i want to either give the user a msg when their string is not entered properly or fix the mistake. since i can't do a loop here (or can i?), i don't know how to do this