Jump to content

Check repetition problem (help)


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

Recommended Posts

I'm burning my brains on something that has to be as easy as 123. But for some reason it doesn't work.

I'm working on a timesheet and want filemaker to mark if a person runs a second shift (on the same day). I have a calculation field which generates a unique id by combining the date and employer id. This number generated is unique, except when a double shift is run (date and employer id are the same, so same unique id is generated).

I then tried a self-joining relation, where this generated id is the relation. I figured a count or sum calculation would do the trick, no luck...

Please comment.

Link to comment
Share on other sites

Shouldn't it be employee id? Anyway, a count of related records, e.g. Count ( selfjoin::EmployeeID ) should produce a correct result - after the current record is committed.

BTW, you do not need the calculation field: you can base the relationship directly on both fields. You can even eliminate self from the count, by defining the relationship as:

Timesheets::EmployeeID = Timesheets 2::EmployeeID

AND

Timesheets::Date = Timesheets 2::Date

AND

Timesheets::TimesheetID ≠ Timesheets 2::TimesheetID

Link to comment
Share on other sites

I got something else... I think it works.

Created a self-joined relationship (named: duplicate shift check) with employer id and date as matches. Sorted by employer id (very important).

Then the following calculation field:

If ( duplicate shift check::double shift checksum = GetNthRecord(duplicate shift check::double shift checksum;Get(RecordNumber)- 1); 1; 0)

It does mark the second shift as '1', but I actually wanted both shifts to mark. So I will look into the submitted suggestions now.

Link to comment
Share on other sites

This topic is 5785 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
×
×
  • Create New...

Important Information

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