I'm having a bit of trouble with searching with search operators in validated fields in Filemaker Pro 13.
I have a field which has validation "numeric only", since it stores a numerical value. However, when I enter find mode I cannot use one of the pre-defined search operators such as * for "zero or more characters" or even # for "any one digit".
When I enter one of these operators in the field and try to search, Filemaker gives me a validation error and says that the field contents has to be numerical.
Is there a way to get around this problem?
That's irritating.
I just:
Created a test file
Created a Number field
Added the Strict data type option and set it to Numeric Only
Made sure validation was set to Only during data entry which should not engage in find mode
Created a couple of records and inserted values into the field
Performed my find for * and got the same error message
This feels like a bug in FileMaker to me. I don't remember running into it in previous versions, but it could be there too. I would not consider Find Mode a data entry mode so you'd think the validation rules wouldn't apply.
All that said, you could use a calc field as a work around.
Crate a calculation field in the same table and name it yourfieldnameSEARCH, e.g. idSEARCH. The calculation for the field can just be the field you actually want to search on:
e.g. `mytable::idSEARCH = mytable::id`
You can set the index to All for the calculation field so that the searching is faster. Since the calculation field is in the same table as it's reference, modifications to the original field will be reflected in the calculation automatically.
Now you can search in the SEARCH specific field without the validation being applied.
As far as the "bug" itself, you can submit it to FileMaker and maybe they'll take care of it or at least explain why it's happening.
This is true going back at least as far as FileMaker 11.
The problem is that * and # are placeholders for characters in strings. The numerical operators, <, >, <=, >=, ... work just fine even with a strict data type of numeric only. = will also work to find blank values.
For a true numeric field, however, these should cover most of your searches:
To find blank values, search for = in the numeric field.
To find all non-blank values, search for = in the numeric field and click omit on the record.
To find values between x and y use x...y in the search field.
Replicating the # operator is trickier. You could possibly replicate it with a new field that calculates the mod of a number or converts the numeric field to a string and get's the nth character.
Apparently, this form of validation is intended for Text fields.
Note that most find operators do work, despite the validation: =, ==, !, ?, ... and all the comparison operators < > ≤ ≥.
If there is a bug here, it concerns the # operator, which Filemaker expressly designates to find "one or more digits in a number field".
Two possible workarounds:
Change the field's type to Text (note that this may affect the way the field is sorted);
Replace the strict numeric type validation with validation by calculation.
Related
I'm trying to match a string of numbers (like 370488004) using the typical INDEX MATCH formula. Unfortunately, in one range the numbers are formatted as plain text, and in the other range they are formatted differently. Usually 'Automatic' or 'Number'. I want to avoid having to update the formatting of both ranges whenever the values get updated (usually via a paste from an outside source). Especially since it's not always going to be me doing the updating.
Is there a way I can write my INDEX MATCH formula so that it ignores the formatting of the values it's attempting to match?
The value returned by the INDEX formula can be in any format. Plain text, number, doesn't matter. The problem is the two values I'm matching are in different formats. I need a formula that ignores that their formatting.
Here's an example sheet:
https://docs.google.com/spreadsheets/d/1cwO7HGtwR4mRnAqcjxqr1qbhGwJHLjBKkp7-iwzkOqY/edit?usp=sharing
You can use VALUE or INT to force it into a number value, or if you want to keep it text use TEXT. Example would be:
=INDEX(VALUE(D1:E4),MATCH(G1,E1:E4,FALSE),1)
The numbers in column D are in fact text, but utilizing VALUE first for the range puts them all in number format. It is finding the value associated with "Green" written in G1. Without seeing a working example sheet this is the best solution I can offer.
UPDATE:
You can use VLOOKUP array with a static range (otherwise error), or QUERY to have the range infinite.
=ARRAYFORMULA(VLOOKUP(VALUE($G3:$G5),$B3:$C,2,FALSE))
=QUERY(FILTER($B3:$C,$B3:$B=VALUE($G3:$G)),"Select Col2")
I'm trying to insert records to a table by using transform maps. I have this field in the target table, which is a choice type, and I have set the choice action in the source table's field to reject if there's no matching value found. But, when I tried inserting the record using the transform map with the correct value, which exists in the choice list of the target field, it still got rejected and hence not inserting the records.
I have tried searching for possible reasons as to why it still got rejected even with correct value in the source field. Here's the sample link that I have found: https://hi.service-now.com/kb_view.do?sysparm_article=KB0677334
It says that if there are more than 40 characters for the choice list value it will be truncated and might not match those choice. But the choices in the target field has only 20 characters or less.
I have first tried running the transform map in the lower environments before proceeding to production. In the lower environment it works fine and the records got inserted. But, when I tried it in production it got rejected.
There is a difference between choice and choice list. Within the choice list the values are comma separated sys_ids. I could imagine that you have multiple values for import and then the max character are reached or the values do not match, etc.
You could use this approach:
Instead of a direct assignment, source to target field, use the script to target. Then you gain the full script power ;)
Maybe here you could add some logic like switch case or whatever, I guess you get the point.
I need an urgent help from you guys, the thing i have a column which represent the full name of a user , now i want to split it into first and last name.
The format of the Full name is "World, hello", now the first name here is hello and last name is world.
I am using Derived Column(SSIS) and using Right Function for First Name and substring function for last name, but the result of these seems to be blank, this where even i am blank. :)
It's working for me. In general, you should provide more detail in your questions on places such as this to help others recreate and troubleshoot your issue. You did not specify whether we needed to address NULLs in this field nor do I know how you'd want to interpret it so there is room for improvement on this answer.
I started with a simple OLE DB Source and hard coded a query of "SELECT 'World, Hello' AS Name".
I created 2 Derived Column Tasks. The first one adds a column to Data Flow called FirstCommaPosition. The formula I used is FINDSTRING(Name,",", 1) If NAME is NULLable, then we will need to test for nullability prior to calling the FINDSTRING function. You'll then need to determine how you will want to store the split data in the case of NULLs. I would assume both first and last are should be NULLed but I don't know that.
There are two reasons for doing this in separate steps. The first is performance. As counter-intuitive as it sounds, doing less in a derived column results in better performance because the SSIS engine can better parallelize the operations. The other is more simple - I will need to use this value to make the first and last name split so it will be easier and less maintenance to reference a column than to copy paste a formula.
The second Derived Column is going to actually perform the split.
My FirstNameUnicode column uses this formula (FirstCommaPosition > 0) ? RTRIM(LTRIM(RIGHT(Name,FirstCommaPosition))) : "" That says "If we found a comma in the preceding step, then slice out everything from the comma's position to the end of the string and apply trim operations. If we didn't find a comma, then just return a blank string. The default string type for expressions will be the Unicode (DT_WSTR) so if that is not your need, you will need to cast the resultant into the correct string codepage (DT_STR)
My LastNameUnicode column uses this formula (FirstCommaPosition > 0) ? SUBSTRING(Name,1,FirstCommaPosition -1) : "" Similar logic as above except now I use the SUBSTRING operation instead of RIGHT. Users of the 2012 release of SSIS and beyond, rejoice fo you can use the LEFT function instead of SUBSTRING. Also note that you will need to back off 1 position to remove the comma.
From IBM iSeries DB2 I recieve a ordered quantity DEC 11,4.
In iReport I use java.lang.Float to print the value. Also I have a pattern #,##0.0000;-#,##0.0000 (4 Decmimal places, 1000 separator).
When something is ordered in Metric Tons, this is no problem, but when something is ordered in pieces, it also prints "2,0000". This is confusing, how do I hide the ",0000"?
You can use two fields (Text Field, for example) for showing value. You can set visibility for fields (with help of "Print when expression" property) - show one field with #,##0.0000 pattern (for metric tons) and hide another with #,##0 pattern (for pieces).
Expression can check parameter or field, for example:
$F{valueUnit}.equalsIgnoreCase("metricTon")
How do you guys treat empty strings with Oracle?
Statement #1: Oracle treats empty string (e.g. '') as NULL in "varchar2" fields.
Statement #2: We have a model that defines abstract 'table structure', where for we have fields, that can't be NULL, but can be "empty". This model works with various DBMS; almost everywhere, all is just fine, but not with Oracle. You just can't insert empty string into a "not null" field.
Statement #3: non-empty default value is not allowed in our case.
So, would someone be so kind to tell me - how can we resolve it?
This is why I've never understood why Oracle is so popular. They don't actually follow the SQL standard, based on a silly decision they made many years ago.
The Oracle 9i SQL Reference states (this has been there for at least three major versions):
Oracle currently treats a character value with a length of zero as null. However, this may not continue to be true in future releases, and Oracle recommends that you do not treat empty strings the same as nulls.
But they don't say what you should do. The only ways I've ever found to get around this problem are either:
have a sentinel value that cannot occur in your real data to represent NULL (e.g, "deoxyribonucleic" for a surname field and hope that the movie stars don't start giving their kids weird surnames as well as weird first names :-).
have a separate field to indicate whether the first field is valid or not, basically what a real database does with NULLs.
Are we allowed to say "Don't support Oracle until it supports the standard SQL behaviour"? It seems the least pain-laden way in many respects.
If you can't force (use) a single blank, or maybe a Unicode Zero Width Non-Break Space (U+FEFF), then you probably have to go the whole hog and use something implausible such as 32 Z's to indicate that the data should be blank but isn't because the DBMS in use is Orrible.
Empty string and NULL in Oracle are the same thing. You want to allow empty strings but disallow NULLs.
You have put a NOT NULL constraint on your table, which is the same as a not-an-empty-string constraint. If you remove that constraint, what are you losing?