Jump to content

Found Set of Unique records based on one field, no repeats


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

Recommended Posts

I have an school attendance roster of three entered classes, with a copied time stamp:

Billy Kidd Math 4/20/2011 1:21:10

Jane Doe Math 4/20/2011 1:21:10

Al Schmidt Math 4/20/2011 1:21:10

Carole King Math 4/20/2011 1:21:10

Bob Tripp Science 4/21/2011 3:18:05

Julie Tool Science 4/21/2011 3:18:05

Art Deli Science 4/21/2011 3:18:05

Joey Twoo English 4/23/2011 9:28:15

Kay Jewel English 4/23/2011 9:28:15

Daddy Love English 4/23/2011 9:28:15

How can I Perform a Find that results in:

...... Math 4/20/2011 1:21:10

...... Science 4/21/2011 3:18:05

.............. English 4/23/2011 9:28:15

One occurrence per class entered

Thanks

Link to comment
Share on other sites

I've found a solid solution (This from a FM-Forums in July 2008)

goto record [first]

loop

exit loop if [ get ( foundcount ) = 0 ]

if [ $id =timestamp ]

omit record

else

set variable [ $id ;timestamp ]

go to record [ next , exit after last ]

end if

end loop

Thanks all for your help, always.

Link to comment
Share on other sites

Actually, you should start by sorting the records. Anyway, now you know what I meant by "disproportionate effort".

Yes, of course. Sorry, sorted first.

And just to say, I so appreciate your help and that of others here. I'm often dead in the water by the time I get here, but I so often feel a discouragement of sorts. When someone says you can't do this, I hear I shouldn't try. But I feel just the opposite. I'm happy to keep trying. At my beginner level, every bit of this is hammering square pegs into round holes, and when it finally works I'm ecstatic.

This isn't disproportionate. It's ten lines of code, it does exactly what I need, and doesn't seem to make FMP bow to my will, rather than the more common me bowing to its will. And I got to use Omit Record for the first time.

Thanks, especially for the conversation. I'm thrilled when I get this stuff to work. Any and all help is always greatly appreciated.

Chris

Link to comment
Share on other sites

When someone says you can't do this, I hear I shouldn't try. But I feel just the opposite. I'm happy to keep trying.... every bit of this is hammering square pegs into round holes, and when it finally works I'm ecstatic

That's part of the problem for people starting out: they ARE trying to put square pegs into round holes. Getting it in doesn't change the fact that it's wrong.

I'm building a house. Which is better for hitting in nails, a glass bottle or a shoe?

Link to comment
Share on other sites

That's part of the problem for people starting out: they ARE trying to put square pegs into round holes. Getting it in doesn't change the fact that it's wrong.

I'm building a house. Which is better for hitting in nails, a glass bottle or a shoe?

Well, a shoe of course :)

Is this the case in my request for my found set? Is it wrong?

I understand I could build this 'better' by using a parent list to make the attendance roster in the first place, but I see a limitation with that.

But I'd say that's not my point.

The responder said "You can't.." (I don't mean to rag on him in ANY way. I so appreciate his and yours and others' help.)

I'm just asking for some encouragement.

Like...

Here's what you've asked for.

Or... Look into Omit Record and you'll find an answer.

BUT, here's why a better structure is better...

It doesn't help to just say I'm wrong, especially when there are almost no resources where newbies can learn that need for structure. I want to hear why. And I won't get it the first time, but I'm really trying. And I'll get it.

Thanks again.

Link to comment
Share on other sites

When someone says you can't do this, I hear I shouldn't try. But I feel just the opposite.

Let me try and put this back into perspective. First, what you did is not a waste of time, because you have learned something. And I think all of us know the addiction of making FMP "bow to our will".

Now, why is this not a good method? Because it needs to process each record individually. With a large amount of records, it will require a disproportionate effort of the computer and an equally disproportionate amount of your time. Why should you care, when you'll only be dealing with a few records at a time? Because a good method is worth learning, and all other things being equal...

I'm just asking for some encouragement.

Like...

Here's what you've asked for.

Or... Look into Omit Record and you'll find an answer.

BUT, here's why a better structure is better...

I don't see why I should have picked Omit Record out of all possible sub-optimal approaches. As for a better method, I have suggested it in my first post - before you mentioned omitting record one-by-one. So basically you're saying that you have asked for directions and you are disappointed by not having been sent down the scenic route you have discovered later by yourself. :P

Link to comment
Share on other sites

Now, why is this not a good method? Because it needs to process each record individually. With a large amount of records, it will require a disproportionate effort of the computer and an equally disproportionate amount of your time. Why should you care, when you'll only be dealing with a few records at a time? Because a good method is worth learning, and all other things being equal...

This! I misunderstood your original comment of 'disproportionate' to mean my use of programming time.

As to large amount of records, my strategy was to archive attendance records. Four hundred students, 20 classes a month, 12 months a year is 100,000 records in a year, five years would be half a million records, but the records are almost never used after their current month. So I'm faced with maintaining two tables, the original parent list of classes that generated the attendance roster for each class, and the attendance roster itself, and faced with operating a very large table on a daily basis. Instead if I can archive the roster and make the roster re-generate its own 'parent list' if ever needed, seems simpler. If that's not a good strategy, if you can point me elsewhere, thanks.

Yes, I did like finding another way. I did try the other, but I don't understand reports and sub-summary fields yet and couldn't get it to work. I'll look again.

Link to comment
Share on other sites

This topic is 4309 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.