### Title

calculation worked in FM11 not in FM12?

### Post

Hello all,

I have a formula that is using a relation to return a number from another table. It worked in FM11. I've set it up the exact same way. The tables are related by hour of day (see below). Then based on what day it is, the calculation returns a value from that day of the week at that hour. I've tried a number of things, and think the problem is with the relation. Both fields being related are a number. Here's the formula:

Let ([

dow = DayOfWeek (Time_calltoqueue_ts)] ;

Case ( dow = 1 ; CoreHours::Sunday ;

dow = 2 ; CoreHours::Monday ;

dow = 3 ; CoreHours::Tuesday ;

dow = 4 ; CoreHours::Wednesday ;

dow = 5 ; CoreHours::Thursday ;

dow = 6 ; CoreHours::Friday;

dow = 7 ; CoreHours::Saturday ; "Error"))

The calculation result is a number as is the value in the other table. I've tried putting a related field for the day of the week on the Main Table and it comes up blank. I've tried changing the THEN part of this calculation with a number instead of the related field to test my logic on this calculation and the formula will result correctly.

Your original file may have been damaged or just the index on that field may have been corrupted.

Try Recover on your original file and see if the recovered copy works. (Do this even if recover does not report fixing any problems.)

If recover does not report fixing any problems and and the copy works, try using advanced recover options to just rebuild your indexes without making any other changes to your file--this is the one "safe" case where I will use a recovered copy.

If you have FileMaker 11 or newer, you can use Advanced Recovery options to rebuild your file's indexes:

Things to keep in mind about Recover:

While Recover almost always detects and fully corrects any problems with your file...

And here's a knowledgebase article that you may find useful: What to do when your file is corrupt (KB5421).