Jump to content

Finding & exporting multiple entries


cabsandy
 Share

This topic is 6590 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hi all,

Happy New Year first of all ;-)

See my attached example file-I have .csv files which are of customer records-I want to Find on the RF node field-I have multiple entries in some cases.

I only want to export , at a maximum, 2 duplicate entries in each case-but the duplicate entries change as you go down the list (I know, sounds wierd but the file explains it hopefully).

I've tried the ! command but that will only show in the Find set 1 of each entry-as this exported file will eventually be imported into a customer managment system, we need more than 1 entry for each part of the network to get a good coverage. I reckon there must be some way of scriting this , with multiple Find ! commands but cant work out how. Can anybody help?

Sandy

raw example.zip

Link to comment
Share on other sites

Hi Sandy,

Ummm.. 'two duplicate entries'. Does that mean an original and two duplicates making a maximum of three for each RF node, or are you counting the original as one of the two?

Irrespective of this, I guess that one method you might like to consider is a script which loops through the records compiling a list of the RF nodes from each record in turn, but first checking if the RF node of the record already appears twice (or three times as the case may be) in the list and if so, omitting the record instead.

Such a script might be constructed along the lines of:

Show all Records

Go to Record/Request/Page [First]

Set Field ["gNodeList_txt", "RF_node"]

Freeze Window

Loop

Go to Record/Request/Page [Exit after Last, Next]

If ["PatternCount(gNodeList_txt & "

Link to comment
Share on other sites

To amplify what LaRetta is saying; it is a small problem when we post code, which you have to understand so as not to get caught by this "gotcha."

If someone answering a question is writing the code out manually, they will tend not to add quotation marks inside the brackets of scripts steps. They'd write:

Set Field [gNodeList_txt, gNodeList_txt & "

Link to comment
Share on other sites

Hi Sandy,

From your description of the problem, I'd say that you are mis-reading my post and the way it is intended to relate to the data entered into the ScriptMaker dialog.

What I've posted should match how the details appear in the ScriptMaker window *after* the script steps have been appropriately configured.

With the Set Field[ ] step, two parameters are required:

1. which field to set, and

2. what to set it to.

The first parameter is set by selecting the step then clicking on the button at the bottom of the dialog which is labelled 'Specify Field', then selecting the target field from the list dialog that appears. The second parameter is set by clicking on the button at the bottom of the dialog which is labelled 'Specify', then entering a formula.

In the final presentation of the script, the square brackets following the command name have both parameters in them separated by a comma, and each parameter is enclosed within quotes. Thus if you are setting a field called 'MyField' and the value you are setting it to is 'MyValue' (which as a text literal, must be enclosed in quotes, you will end up with:

Set Field ["My Field", ""MyValue""]

However the outer sets of quotation marks around each parameter and the comma between the first and second parameters are not required to be entered by you. FileMaker adds them for you when displaying the script in the dialog. All you need to do is select MyField from the Specify Field list and then type "MyValue" into the Specify dialog (only one pair of quotes and FileMaker will do the rest).

Going by your last post, it sounds as though you were trying to enter both the Set Field parameters into the one dialog (the 'Specify' calc dialog), and were entering the enclosing quotes as well as the content. If you follow the procedure as I've outlined it here, you should find that you have more success.

Link to comment
Share on other sites

Yes, I frequently print a script to generic text/only but after pasting, I remove those quotes throughout. It's a pain but I think it avoids confusion for the person reading them, particularly when calculations themselves involve quotes. smirk.gif

LaRetta

Link to comment
Share on other sites

Yes, I guess we should remove the quotes. Probably easier for me than the person trying to implement it, who's not aware of this. It would not be terribly difficult in a text editor (where I often have to change names - to protect the innocent :(-). Every [" and "] should be [] (real text quotes being doubled there). I can't promise I'll remember. I rarely post an entire script.

Of course then we may confuse someone who looks at their own scripts and sees "Mine have quotes. Why don't theirs?"

Link to comment
Share on other sites

First of all, Ray, thanks for the detailed description-now I understand how it works, it makes trying to fix it so much easier. To everybody else who answered, thank you very much. I spent about 4 hours over a hot laptop and my FMP Bible trying to work out what I had wrong but gave up, through sore eyes :(-), and decided to ask the experts.

2 things Ive learned-the importance of quotation marks and using the inbuilt functions of FMP rather than copying word for word

Thanks again

Sandy

Link to comment
Share on other sites

This topic is 6590 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.