Moving up one level in a FM file computed field

67 views
Skip to first unread message

Michael Reach

unread,
Apr 13, 2022, 12:25:21 AM4/13/22
to Hardhats
How would one define a computed sub-field in a multiple field that refers to the parent? For instance, here's an entry from the top level:
NUMBER: 349                             NAME: FH9
  DESCRIPTION: Hematology Auto Differentials
  DO NOT MONITOR?: NO                   DISPLAY DESCRIPTION: Hematology
  PROVIDER: CAP
SURVEY: Hematology
  PROVIDER SURVEY PARENT (c): FH9
SURVEY: Blood Cell ID
  PROVIDER SURVEY PARENT (c): FH9


Here SURVEY is a multiple field, .its 01 is Hematology, and the other sub-field, PROVIDER SURVEY PARENT, refers back up to the top-level .01 field name FH9. The same for the other SURVEY value Blood Cell ID.
How does one define this computed field, that points to the level above?

In case you're wondering, why in the world would I want such a field? - I did a Cache extract FM-->SQL using the Fileman Wizard in Cache' SMP. It turns the multiple field SURVEY into a separate SQL table, with difficult-to-read pointers back to the top-level file/table PROVIDER SURVEY. I thought it would be helpful to the user who links with ODBC, if the sub-table contained an actual field with the top-level (PROVIDER SURVEY) name.

Thanks,
Michael Reach

George Timson

unread,
Apr 13, 2022, 2:37:55 PM4/13/22
to Hardhats
You seem to have created already the computed field you want, naming it PROVIDER SURVEY PARENT.

Under SURVEY, you could have used the computed expression
     PROVIDER SURVEY NAME
This is the top level file name, followed by top level field name.

--George Timson

Michael Reach

unread,
Apr 13, 2022, 9:04:34 PM4/13/22
to Hardhats
Thank you. That works. You don't need a colon between them?
Reply all
Reply to author
Forward
0 new messages