Jump to content

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

Recommended Posts

Posted

I am building a database for kitchen cabinets that uses a lot of conditional statements. I have 40 cabinets in this database.

I am trying to figure out how many cabinet doors I have to build based upon which cabinets I have selected from my library (global - repeating field).

I do this right now with a CASE calculation.

In the Case that style of cabinet = B21...Quantity of Doors = 2

I reference 40 possible styles of cabinet with this CASE calculation.

Would this type of calculation be more efficient with a SET FIELD script or the CASE calculation?

Thanks a lot for your help.

I've learned a bunch of stuff from this website!

Posted

Well, you could use a script, but this sounds like it would work fine with a Lookup. That is, if you lose the "global repeating field" and use a real record for each cabinet you want to build. It seems to me you're short-circuiting FileMaker by being "efficient." It's better to store the data in real records, and use relationships or self-relationships to bring it together.

It may seem like overkill at this point, but it will solve so many problems to set things up with proper relational structure.

In this case you have a "project" that has x number of cabinets, each of which has a particular style, the combination of which determines the number of doors.

I'd have a Projects and Customers file also, but you didn't ask about that, so we'll leave them out. But you need a file for the Project-Cabinets you build.

You also need a file that has the Cabinet stock. And you need a way to assign a style and number of doors to each unique combination of cabinet-style. This could all be done in one file, with an entry for each combo.

In any case, back in your Project-Cabinets file, once you choose an ID that identifies the above,* the number of doors would be defined as a Lookup on a relationship to wherever the "number of doors" information is (Cabinet stock).

*This might best be done with 2 value lists. The 1st would be Cabinets (all cabinets, or filtered by some category).

The 2nd would be a "filtered" value list, restricted by a relationship on the cabinet choice, displaying the Style field, limited to only those which are available for that cabinet choice.

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