Thank you for your post.
Assuming you have a relationship into your second file, use the Sum() function in a calculation to total the records in the second file. This total will then appear in the first file, and that information can be evaluated and used in a script. For example, your script may look like:
Go to Record/Request/Page [ First ]
If [ Value > 1000 ]
Send Mail [ SMTP Server ; No dialog ; ...... ]
Go to Record/Request/Page [ Next ; Exit after last ]
That is, we go to the first record and enter a loop. We evaluate to see if the Value (Calculation) is greater than 1000. If so, then we send an email. Regardless, we skip to the next record and exit the loop after finished.
If you need clarification, please let me know.