March 25, 20232 yr I can't go into too much detail, much the same issues exist in a recipe, or a tech tree in some game. I am converting a variety of information into a FMP.19 database. One of the items is a part, which may require other parts to make it. Each part is listed with its immediate parents, so for example: Part (1): No parents Part (2): No parents Part (3): (1) Part (4): (2) and (3) I need to be able to identify all ancestors, not just the immediate parents I am given, so from the above data I would need to identify (4) as (1), (2) and (3), since (3) also requires (1). I can do this with a recusive loop that traces up the parentage tree, and takes a bazillion searches and markers. There are only a couple dozen items in the sample data, but this will certainly exceed a thousand items, possibly many thousands. Some of the ancestor trees could be dozens or potentially hundreds of items long, tracing up through lots and lots of generations. This is exactly the sort of problem FMP is designed to solve, but darned if I can figure out any other way to do it. Does anyone have any suggestions on possible strategies? Thanks for your time. Edited March 25, 20232 yr by elipsett
March 25, 20232 yr You are describing a BOM (Bill Of Materials). This has been discussed several times, most recently here: https://fmforums.com/topic/107672-shopping-list/?do=findComment&comment=485232&_rid=72594 Note that with a tree "potentially hundreds of items long", you won't be able to rely on a cascading calculation. You will need to produce the list by script - either on demand, or every time you make a change anywhere along the tree. In any case, it should not "take a bazillion searches and markers". You just keep moving up (or down) the tree using the Go to Related Record script step. That doesn't mean it is a trivial task, but it should be doable. On the same note: 3 hours ago, elipsett said: This is exactly the sort of problem FMP is designed to solve Not really. Filemaker is a relational database. It makes it possible to implement a BOM, but it is at the edge of its capability.
March 26, 20232 yr Author Thank you. Yes, it would be a BOM; never occured to me to look in that direction even though I've been used by them in the past. And the link you provided offers a new strategy to look into, which I will do.
Create an account or sign in to comment