filemaker find specific value with a dropdown menu - search

I have created a FM-DB with some drop down fields. The problem is, that when I go into search mode and choose e.g. the number "1" in the drop down field and start the search, then I get also all records with the number 11, 12, 13 ... in that particular field.
Is there a way to tell FM to search only for an exact value? Since it is a Dropdown I can't enter the = before the value.
Thx for your help.
Dan

Fields that are type 'text' will search as you have indicated above: matching the first characters of the search string. For example, searching in a text field for 'sta' will find 'stack' and 'stacy' and 'stairs'. In your example the search is for a leading '1' in a text string, which will find '1', '10', '11', etc.
Changing your field to type 'number' should provide the numeric search that you are expecting, where a search for 1 will only find values equal to 1.

Related

match substring against text values arranged in a excel table

I am trying to achieve this result: assign a category to a document based on its title, or part of its title.
Title
Category
correspondence
Correspondence
Note Transmission Correspondence
Correspondence
Advisors Evaluation Report
Report
Country Notes
Correspondence
Annual Portfolio Report
Report
Appointment Letter
Correspondence
The categories are arranged into a table (docCategories) where each row starts with a unique category name, and is followed by a set of labels that match entirely or partially with the document title.
Category
Label
Label2
Label3
Label4
Correspondence
Letter
Memo
Note
Correspondence
Report
Dashboard
Report
The formula will take the document title and check if it matches any of the labels (with wild cards), so to return the unique category in the first position in the same row of the matched label.
Appointment Letter -> matches label:letter -> cat:Correspondence
I have made it working with this formula to be copied in the Category column:
=INDEX(docCategories;MIN(IF(docCategories=A2;ROW(docCategories)))-1;MIN(IF(docCategories=A2;1)))
And only if the title is exact matching of the entire label (e.g. Correspondence -> matches label:correspondence -> cat:Correspondence).
I am looking to have it working for matching on part of the title (e.g. Appointment Letter -> matches label:letter -> cat:Correspondence).
I have tried and failed to change the docCategories=<title> into something that can match the substring of the title, even applying the SPLITEXT(<title>) it still fails to give me the expected result.
Who can think of a creative solution for this?
The following solution works for any number of categories and for any number of labels on any category. It also identifies if no labels were found and also if more than one label was found from a different category. Since the question doesn't specify any specific excel version tag I assume Microsoft Office 365 function can be used.
On cell I2 put the following formula:
=LET(rng, A2:E3, texts, G2:G9, lkupValues, B2:E3, categories, INDEX(rng,,1),
BYROW(texts, LAMBDA(text,LET(
reduceResult, REDUCE("",categories, LAMBDA(acc,c, LET(
lkup, XLOOKUP(c,categories, lkupValues), searchLabels, FILTER(lkup, lkup<>0),
IF(SUM(N(ISNUMBER(SEARCH(searchLabels,text))))=0, acc,
IF(acc="", c, "MORE THAN ONE CATEGORY FOUND"))
))), IF(reduceResult<>"", reduceResult, "CATEGORY NOT FOUND")
)))
)
and here is the corresponding output:
The last two rows Title column were added to test the Non-Happy paths.
Explanation
We use LET function to define the names to be used and to avoid repeating the same calculation. If in your excel version you have DROP function available, then the name: lkupValues can be defined as follow: DROP(rng,,1).
The main idea is to iterate over texts values via BYROW and for each text we invoke SEARCH function for all categories. When the first input argument of SEARCH is an array, it returns an array of the same shape indicating the start of the index position of the labels found in text or #VALUE! if no labels were found.
Note: SEARCH is not case sensitive, if that is not the case, then replace it with FIND.
We use REDUCE function to iterate over all categories to find a match. For each category (c) we find the corresponding labels via XLOOKUP. Since not all categories have the same number of labels, for example Report has fewer labels than the Correspondence category. We need to adjust it to remove empty labels. The name searchLabels filters the result to only non-empty labels.
For checking if labels were not found we use the following condition:
SUM(N(ISNUMBER(SEARCH(searchLabels,text))))=0
ISNUMBER converts the SEARCH result to TRUE/FALSE values. N function converts the result to equivalent 0,1 values.
If the condition is TRUE, it returns the accumulator (acc initialized to an empty string). If the condition is FALSE, some labels were found, then it returns the category (c) if acc is empty, i.e. no previous categories were found. If acc is not empty any previous category was found, so it returns MORE THAN ONE CATEGORY FOUND.
Finally, if the result of REDUCE (reduceResult) is an empty string, it means the accumulator was not updated after initialization, so no labels were found for any category and it is indicated with the output: CATEGORY NOT FOUND.

EXCEL - Replace function | Replace value from one column to replace with other column value

Input should be like,
schema name
schema value
ps_din_ghr_${hiveoff:suffix}
post
and output should be like below in new coulmn:
schema name
ps_din_ghr_post
i want to replace after $ part with the value from the side column.
please let me know how to execute this using excel. thanks in advance
EDIT : For English users replace ; by , in the formula
You can use SEARCH to get the position of the $ and REPLACE everything after it.
For example with schema name in column A and schema value in column B -> result in column C.
To find the $ you need to use SEARCH("$";A2) it will give you the position.
Then you can count the number of characters to replace after the "$" by substracting the position to the length of the schema name with LEN(). (+1 to get the last char)
Then you can combine everything :
=REPLACE(A2;SEARCH("$";A2);LEN(A2)-SEARCH("$";A2)+1;B2)
Result in my Excel :

PowerQuery remove items from a list matching a pattern

Using PowerQuery in excel how can I remove items from a list that match a pattern.
I have a column with cells that contain names and numeric id's. I want to be left with just a list of names.
LastName, FirstName;#123;#LastName, FirstName;#321;
The numbers are all unique. So if I had regex the pattern would be similar to
/^\#ddd+$/
I can split the cell into a list using ';' as a separator.
= Text.Split([Consultant],";")
If there was a way to remove every 2nd item until the end that could work too. Unfortunately it seems there is no way to specify patterns to match.
List.RemoveItems({1, 2, 3, 4, 2, 5, 5}, {2, 4, 6})
This would be awesome however I have to define all the number patterns that exist. So this fails.
List.RemoveMatchingItems(Text.Split([Consultant], ";#"), {1,2,3,4,5,6,7,8,9})
Method2
I split the text into a list as above. This gave me a column of lists. So I expanded the lists in columns to new rows. My plan was to remove alternate rows. However, remove alternate rows requires an end number. I would need an argument to go until there are no more arguments to process.
There are many ways.
One way is to select every other item with List.Select
In your example, these would be the items with an even number position.
let
x = Text.Split([Column1],";#"),
y = List.Select(x, each Number.IsEven(List.PositionOf(x, _)))
in
y
Edit Nov 2022
Another method or removing every other would be:
=List.Alternate(Text.Split([Column1],";#"),1,1,1)

Multi-select fields on Generic Inquiry

How do you filter on multi-select fields on generic inquiry?
Assuming your data looks like this :
ROW VALUES
A 1,5
B 3,4,5
C 5
D 1,2,3
E 2,4
And you want too search for records where there is either 1 or 3. So it should show rows A, B & D. I'm not sure if its possible. So the alternative would be write a custom screen and manipulate via view delegate. I could be wrong though.
TIA
The PXMultiSelector editor control persists the values in string format
How to filter depends on the format. Email address for example have a pre-determined format. For those you can add a standard string filter like Field Contains c#d.com
That wouldn't work for numbers. If you search for number 1 in list 2,4,15 it would return the result because 15 contains 1. To workaround this issue you can add a custom unbound DAC field. In the DAC field property getter you can parse the value of the multi-selector field and reformat it to a pre-determined format like ,2,4,15, and filter on ,1, instead of 1.

Containing a word in string and recording the following string

I have about 1000 or so lines in orginal dataset. I need to use the isnumber(search(substring, string)) to find if my substring is in the column. IT reports TRUE or FALSE. I have up to three possible outcomes for if its TRUE, if its FALSE I will have 0 outcomes.
However, in stead of it reporting TRUE I would like to choose which of the Three outcomes I can record, and I would like to record the string.
I have tried using =isnumber(Search(substring, string))
=isnumber(search(substring, string))
My first column is
AAA-1-2
The column Im search for my strings will contain...
AAA-1-2-1
AAA-1-2-2
AAA-1-2-B
I would like to pick from these...I would only like to choose AAA-1-2-1.
Thank you.
So the result would look like...
First column
AAA-1-2
Second column
AAA-1-2-1
Use VLOOKUP with a wild card:
=VLOOKUP(C1&"*",A:A,1,FALSE)
But based on your last deleted question I believe you really want:
=INDEX($A:$A,AGGREGATE(15,7,ROW($A$1:$A$3)/(ISNUMBER(SEARCH($C1,$A$1:$A$3))),COLUMN(A:A)))
To show that order does not matter:

Resources