© Matti Mattila, CPFA, CISA, CIA

4. Text Search Macro

Next item Previous menu
Computers are good in search because of speed, accuracy and cheapness of work. IDEA provides you with good browsing and search possibilities, including, but not limited to, the following.
- Infomation in records can be displayed using various criteria (only records fulfilling given criteria, only fields of interest, etc.).
- Search results can be displayed in desired layout (field order, color, stacked to right etc.).
- Records of interest can be searched using information of several fields at the same time.
- You can proceed from "big picture" to details (individual records) by means of drill-down [1].
However, incorrect data input can make EDP-based search ineffective. Some obstacles in text search can be overcome using (1) either upper or lower case letters; (2) @isin function; (3) @soundslike function; (4) @ltrim function; or (5) combination of all above - e.g. @isin("CORR";@UPPER([Character Field])) .OR. @soundslike("CORRECT"; @UPPER([Character Field]))=1.
I supplemented my search tool box with a macro that finds records with best match in terms of contents of any character field in any IDEA file. The macro makes extensive comparison of all successive character combinations between the string to be searched and the contents of the field where the search takes place. It
- takes into account writing mistakes (to some degree)
Picture 1; See how results look like.
- makes use of all information you put as search criteria [2]
- is easier to use than using combination of numerous @isin statement combinations
- can use also a string exceeding lenght of the field you are making the search in; just select "String is longer than field"
- writes the results in a text file that I can examine e.g. using note pad.
The macro became not as good as I hoped:
- it is case sensitive [3]
- due to heavy computing depending on the field lenght and string lenght and processing capacities of your computer the analysis can take from tens of seconds to several tens of minutes
- trying to stop macro while its is running may result IDEA in non-response state.
You can download its demo version here. Its functionality is limited up to first 500 records.

[1] In IDEA 2002 drill-down is available in field statistics, and in all analyses, where results can be shown on tab (among Database, History, and Field Stats tabs; e.g. Benford analysis, Stratify Database; and Summarization Results).
[2] Here the underlying idea is: bringing together several pieces of weak information helps in hitting the right record(s).
[3] To overcome problems of case-sensitivity make a virtual field getting contents from equation @upper([character field]) or @lower([character field]).