Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm not sure how to word this, but I have an Excel spreadsheet that contains some account numbers that we need to use for reporting purposes. Because this field is manually entered by multiple agents, the data formatting/length is not uniform and contains an array of text and numbers.
Without going back and fixing the data, is there a way I can limit and pick out only the entries with 10 or less numbers (These are valid)? I have already removed all alpha characters from the mix, but I have data that looks like the below. Can I use the "LEN" function somehow? Anyone have some suggestions?
Try this may be:
If(Len(Trim(ACCTnum)) <= 10, Num(ACCTnum, '0000000000')) as TEST2
You sure can:
LOAD FieldNames
FROM Source
Where Len(Trim(A)) <= 10;
Doesnt work, using this to create a field and see what it contains, but I am getting "-1" and "0" as my only results.
LEN(TRIM(ACCTnum))<=10 as TEST2,
To create a field, try this:
If(Len(Trim(ACCTnum)) <= 10, ACCTnum) as TEST2
Perhaps create a straight table with ACCTnum as a dimension and then you can test your expression in the chart without needing to reload the data each time.
Try adding the expression len(trim(ACCTnum)) so you can compare the source data and output.
0 = false
-1 = true
yep, thanks, I am aware of this part.
alright, so this sort of seems to be working better.
I have one more question then, with the remaining accounts I have, is there a way to add leading zeros if the account is under 10 digits? I have some accounts left over that are under 10 digits that should have them. Simple formatting change in the field creation??
Ex. 456789 --------> 0000456789
Try this may be:
If(Len(Trim(ACCTnum)) <= 10, Num(ACCTnum, '0000000000')) as TEST2
Hi,
maybe
LOAD A
FROM YourExcel.xlsx (ooxml, no labels, table is Sheet1)
Where Num(A)<10000000000;
regards
Marco