How to extract numbers from string in spotfire ...
Example:
Input column: ACD:1234F
Output column: 1234
Help is really aprreciated
Please look at these questions you posted and accept the answers if you feel they are correct. I know for certain they are correct.
Spotfire IF Statement in Custom Expression
how to eliminate outlier in spotfire box plots
For this case, this will extract numbers. Just replace [Column1] with what ever your column is.
RXReplace([Column1],"(?!\\d).","","gis")
Column1 NumberExtract
1a2b3c4d 1234
123abc345 123345
abc123def 123
the following expression uses Regular Expressions to strip all non-numeric characters from a string:
RXReplace([col], "[^0-9]", "", "g")
some samples:
INPUT OUTPUT
abc123 123
123abc123 123123
oi3eliu2h4rli24j 3242
as you notice this will simply strip the non-numerics and combine all digits into one string. it does not account for the first or second instance of a number. if you have edge cases, you'll need to share some more data for us to help.
if this solves your issue, please don't forget to accept the answer.
Related
I have a table in an Excel sheet and I use Advanced filter to sort out data. One column of the table consists of number ID like this:
81089
81087
81009
81023
91087
91065
I found out that wildcards (*) doesn't work with numbers. Even if the numbers are formated as text. My question is how to make a simple filter where I would like to sort out numbers starting with 81 as 81* doesn't work. From what I've read and found filtering numbers should work only with logic operators (< > =). Isn't there a trick how to get around with this?
Thanks for any answer in advance.
Use a mathematical equivalent.
For example, if all of your numbers are five digits, as you show in your screenshot, then
Another method is to use a text function as a formula criteria. Then the number of digits is irrelevant.
For example, if your first data element is in A18:
=LEFT(A18,2) = "81"
I have a list of vocabulary in Excel in a given language.
The thing is, this language has four diacritical letters: č ǧ š ț, which are letters on their own and are placed after their respective 'mother characters', but Excel ignores them and mixes up diacritic and non-diacritic versions.
So for example I have:
sete
ši
sieta
When it should be:
sete
sieta
[...]
suona
šconda
[...]
ši
How can I solve this?
Thanks in advance.
A workaround that might do the trick is to put the letters in a separate table that has 2 columns - letter and sort number.
Then create a helper sort column that looks up the table to give you a sort using vlookup / index match. If it is applicable you might also want to add the remaining characters to make the sorting more accurate.
It will be sorted correctly if your windows reginal settings are set for your country.
This is not your average vlookup error.
I have two Power Query tables that I've setup. One is coming from a CSV file with a list of names. The other is from a website pulling a list of names.
i.e.
=John Smith = John Smith would not be true for some reason.
They vlookup should be able to find the name easily. I've tried proper,upper, clean, trimming and text to columns and everything else that I could think of. I've changed data types to no avail.
I know that one query is causing the issue. I can type the name exactly and do a vlookup from one, and it works. The second query that I do this to doesn't return anything on the typed text.
Anyone encounter this issue while using Power Query?
EDIT: See Jeeped's Answer - When I replace the space from the web query with a normal space it works.
#Jeeped's comment has a good answer:
Assuming you have already trimmed off leading and trailing spaces, one of the John Smith entries (likely the one from the web) uses a non-breaking space (e.e. CHAR(160) or ASCII 0×A0) instead of a regular space (e.g CHAR(32) or ASCII 0×20). Use
=CODE(MID(A$1, ROW(1:1), 1))
on both, fill down to get a ASCII code for each letter and compare the numbers.
In MS Excel, I would like to format a number in order to show only thousands and with 'K' in from of it,
so the number 123000 will be displayed in the cell as 123K
It is easy to format to show only thousands (123), but I'd like to add the K symbol in case the number is > 1000.
so one cell with number 123 will display 123
one cell with 123000 will show 123K
Any idea how the format Cell -> custom filters can be used?
Thanks!
Custom format
[>=1000]#,##0,"K";0
will give you:
Note the comma between the zero and the "K". To display millions or billions, use two or three commas instead.
Non-Americans take note! If you use Excel with "." as 1000 separator, you need to replace the "," with a "." in the formula, such as:
[>=1000]€ #.##0." K";[<=-1000]-€ #.##0." K";0
The code above will display € 62.123 as "€ 62 K".
[>=1000]#,##0,"K";[<=-1000]-#,##0,"K";0
teylyn's answer is great. This just adds negatives beyond -1000 following the same format.
Enter this in the custom number format field:
[>=1000]#,##0,"K€";0"€"
What that means is that if the number is greater than 1,000, display at least one digit (indicated by the zero), but no digits after the thousands place, indicated by nothing coming after the comma. Then you follow the whole thing with the string "K".
Edited to add comma and euro.
The examples above use a 'K' an uppercase k used to represent kilo or 1000. According to wiki, kilo or 1000's should be represented in lower case. So, rather than £300K, use £300k or in a code example :-
[>=1000]£#,##0,"k";[red][<=-1000]-£#,##0,"k";0
I've found the following combination that works fine for positive and negative numbers (43787200020 is transformed to 43.787.200,02 K)
[>=1000] #.##0,#0. "K";#.##0,#0. "K"
I was wondering how one would go about filtering a set of column data e.g.
BLK 123 123456
BLK 123
Basically I want to display BLK 123 123456
Any idea how i would go about doing that? Ive tried Filter Custom Filters to set more than 100000, but it wouldn't work as its a text field.
Any help?
You're trying to make some kind of regular expression, correct?
So, the answer involves something along the lines of [0-9]{6}, or \d{6} if you prefer...
This formula will check cell A1 for a match.
=MATCH(TRUE,VALUE(MID(A1,{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20},6))>99999)
It works by grabbing 6 characters at a time, each starting at index 1...20, converts all of them to values, then to Boolean true if the value is >= 99999, then searches for TRUE. If a match is found your string has 6 digits (somewhere in the first 26 characters).
From the title of your question I believe this was what you're asking. From the body of your question, I suppose the application of this solution would have to be the formula in another column.