How do I import data from a .xlsx file to Filemaker Pro if the "matching" field has trailing zeros? - excel

I am importing data from an Excel file into a Filemaker Pro database (FMP 12.0 v5 for Mac). I am using the imported data to "Update matching records in found set". However, the field that I am using to match occasionally contains trailing zeros.
When importing, FMP does not match the fields correctly, because it ignores the trailing zeros.
To explain further: the field in the database is a calculated text field, "courseID.personID", determined by concatenating the numerical "courseID" and "personID" fields (with a dot in between them). The field in my Excel file is formed similarly, using Excel formulae. Some "personID" values end in a zero, e.g. 120, and so courseID.personID becomes something like "123.120". I am matching the Excel field to the FMP field.
I first noticed this was happening, and was very careful to go back to Excel and make a new file (to start fresh), select all cells and set format to Text. Then, I did a Paste Special from my original data, and selected Paste as Values. All the cells in the courseID.personID column gave a "number stored as text error", with the option to convert the text to numbers. I selected the option to ignore the error, to leave all the data stored as text, with the intention of preserving the trailing zeros.
Alas, the issue persists. So, does anyone have any ideas of how to force Excel to format and communicate the proper values? Or, is it an issue of making FMP interpret the data properly, maybe by adjusting field types?

the field in the database is a calculated text field,
"courseID.personID", determined by concatenating the numerical
"courseID" and "personID" fields (with a dot in between them). The
field in my Excel file is formed similarly, using Excel formulae.
Come to think of it, the simplest solution would be to eliminate the calculation fields and use the original values for the import:

Related

Sorting txt data files while importing in Excel Data Query

I am trying to enter approximately 190 txt datafiles in Excel using the New Query tool (Data->New Query->From File->From Folder). In the Windows explorer the data are properly ordered: the first being 0summary, the second 30summary etc.
However, when entering them through the query tool the files are sorted as shown in the picture (see line 9 for example, you will see that the file is not in the right position):
The files are sorted based on the first digit instead of the value represented. Is there a solution to this issue? I have tried putting space between the number and the summary but it also didn't work. I saw online that Excel doesn't recognize the text within "" or after /, but I am not allowed to save the text files with those symbols in their name in Windows. Even when removed the word summary the problem didn't fix. Any suggestions?
If all your names include the word Summary:
You can add a column "Extract" / "Text before delimiter" enter "Summary", change the column type to Number and sort over that column
If the only numbers are those you wish to sort on, you can
add a custom column with just the numbers
Change the data type to whole number
sort on that.
The formula for the custom column:
Text.Select([Name],{"0".."9"})
If the alpha portion varies, and you need to sort on that also, you can do something similar adding another column for the alpha portion, and sorting on that.
If there might be digits after the leading digits upon which you want to sort, then use the following formula for the added column which will extract only the digits at the beginning of the file name:
=Text.Middle([Name],0,Text.PositionOfAny([Name],{"A".."z"}))

Excel: Inconsistent sorting criteria from 'Smallest to Largest' to 'A-Z'

Situation:
I am pulling information from a database and exporting it into an Excel 2010 template. The data consists of unique IDs (numeric), dates, and text in their respective columns. When going to sort, Excel usually recognizes the unique IDs as text and gives me the option of 'A-Z' which yields the correct result.
Problem:
Occasionally when sorting the unique IDs, Excel will give me the option to sort from 'Smallest to Largest' and when this happens the report yields a wildly incorrect result.
Pattern:
The sorting criteria is the only common denominator when a report fails, which makes little sense as they are both ascending orders. This issue only occurs ~20% of the time. The other times it sorts correctly from 'A-Z' as it does in the other worksheets within the same template.
-I've tried changing Number Format within the drop down to 'Text' 'General' and 'Numbers'
-I've tried manually sorting the data through filters as opposed to sort hierarchies
-I've tried clearing the table, and re-copying/pasting the data into the template's worksheet. This seems to work, but as the end goal is automation, I'd like to find out what the root cause is.
Expected result: Numeric data copied and pasted into the field to be sorted from 'A-Z', resulting in a successful report.
Actual result: Numeric data copied and pasted into the field typically results in the sort option of "A-Z', but occasionally sorts from 'Smallest to Largest' resulting in a failed report.
Excel is designed for numbers - and is generally very helpful in coercing text to numbers where appropriate. However, once in Number format the reverse is not easy. As you have discovered, merely choosing Text as format is not enough.
A clue is whether or not (assuming activated) the cells show green triangles.
Other than starting afresh with data entry into a cell already formatted as Text, the conventional solution for conversion with code is to prepend a quote, though appending a space would also serve.
Other than that, the easiest mass conversion approach may be to copy into Word (Keep text only) and copy back to Excel with pasting as Text.
The better solution may be to store IDs as text and prepend 0s to a standard length.

Can you use excel formulas on report data?

So i have some rdfs that download from the server through rwservlet as excels (xls). My question is: can i use excel formulas like sum on the report returned data?
I tried formatting the data (i think here relies the problem as it seem it doesn't affect the data that's already there) and modifying the decimal separator to "." from the rdf. Neither work, not separate or together; the sum formula returns 0. However if i overwrite new data over report data in a field, sum works.
It seems to me it sees all the data returned from the report like text and the formatting doesn't affect the already there data.
Thank you
I go to the root of the problem: the format mask in the rdf was adding a space for sign for the positive numbers. Hence excel was not recognizing it as a number. Problem is after i put a "-" in the format mask to get rid of the space excel re-formats the number automatically from 1.00 to 1 for example. So basically the format mask in the rdf is overwritten, i could not use it at all and i'd get the same result.

CSV - need comma at the start when first field is not present - csv generated from excel

I am using excel to generate comma separated values. I have a parser to parse the csv data and insert to database.
The issue I face is, the first field in my csv is not mandatory. When the first field is null, the generated csv has no comma BEFORE the second field and for the parser the second field becomes the first field.
When the first field is null, I expect the data to be like below.
,SECOND_FIELD, THIRD_FIELD
I have tried
putting a space in the first field. In this case I wil have to change my parser.
Putting a static header. Then the comma is coming as expected in the underlying rows when first field is null. Change in parser will be required.
Putting a comma in the first field, but this is put as ",". :-)
Can someone through some solutions or workarounds ?
Thanks
Quick workaround: Why don't you check how many values are present? If one is missing, asume it's the first one.
EDIT:
I've found this question that may help you. In a nutshell: apply any formatting to the range of cells you are using so Excel doesn't skip any of them when exporting. Also, I think that if you can swap the first column (optional) with any other one (required), it will work, too.

Prevent comma-separated list of numbers being interpreted as single large value

33266500,332665100,332665200,332665300 was the original value, cell should look like this: 33266500,332665100,332665200,332665300 but what I see as the cell value in excel is 3.32665E+34
So the question is I want to convert it into the original string. I have found format function on google and I used it like these
format(3.32665E+34,"standard")
giving it as 332,6650,033,266,510,000,000,000
How to parse it or get back the orginal string? I belive format is the function in vba.
Excel has a 15 digit precision limit. If the numbers are already shown like this when you access the file, there is no way to get the number back - you have already lost some digits. VBA code and formulas will not help you.
If this is not the case, you can add a single quote ' mark before the number to store it as text. This will ensure Excel does not try to treat it as a number and thus lose precision.
If you want the value kept exactly, store the data as a string, not as a number. The data type you are using simply doesn't have the ability to do what you are asking it to do.
If you're starting with an Excel file that has already been created then you've already lost the information: Excel has tried to understand what it was given and its best guess has turned out to be wrong. All you can do (if you can't get the source data) is go back to the creator of the Excel file and tell them what's wrong.
If you're starting with, say, a text file that you're importing, then the news is much better:
If you're importing manually using the Text Import Wizard, then at "Step 3 of 3" you need to set "Column Data Format" for the problem field to "Text".
If you're using a macro, you'll need to specify a value for the TextFileColumnDataTypes property that does the same thing. The easiest way to get it right is to use the Macro Recorder.
If you want the four values in the string to be separate cells, then again, look at the Text Import Wizard settings: in Step 1 of 3 you need to set "Delimited" data type (usually the default) and in Step 2 make sure that "Comma" is checked.
The value needs to be entered into the cell as a string. You need to make whatever it is that inserts the value preceed the value with a '.

Resources