B
band1t
Guest
I am creating a DB where the major focus is ease of maintainence for the end user.
I have a query that calculates the "exposure" caused by several different "hedges". Different type hedges have their exposure calculated using different formulas.
I want one query that will return all of the exposures for the different hedges. Currently I have a field called "hedge type" and one called "exposure".
I can put a nested IIF or a switch in the exposure field to use a different formula based upon the hedge type.
What I want to do is move this functionality to a table with 2 attributes (hedge type and formula) so that the end user will only have to edit this table when adding a new hedge type, not edit the query code.
I can call the formula from this table I have created, but I cannot get it to resolve, it just returns the text. Is this possible and if so, how?
Here is my example, somewhat simplified of course:
Hedge Table
HedgeID
HedgeType
ValX
ValY
Formula Table
HedgeType
Formula
Exposure Query
Field: HedgeID HedgeType ValX ValY Formula
Table: Hedge Hedge Hedge Hedge Formula
If the formula stored in the formula table for a specific hedge type were ValX-ValY, I want to resolve that value, not just display that text.
Hopefully this makes sense.
Thanks,
Graham ...

I have a query that calculates the "exposure" caused by several different "hedges". Different type hedges have their exposure calculated using different formulas.
I want one query that will return all of the exposures for the different hedges. Currently I have a field called "hedge type" and one called "exposure".
I can put a nested IIF or a switch in the exposure field to use a different formula based upon the hedge type.
What I want to do is move this functionality to a table with 2 attributes (hedge type and formula) so that the end user will only have to edit this table when adding a new hedge type, not edit the query code.
I can call the formula from this table I have created, but I cannot get it to resolve, it just returns the text. Is this possible and if so, how?
Here is my example, somewhat simplified of course:
Hedge Table
HedgeID
HedgeType
ValX
ValY
Formula Table
HedgeType
Formula
Exposure Query
Field: HedgeID HedgeType ValX ValY Formula
Table: Hedge Hedge Hedge Hedge Formula
If the formula stored in the formula table for a specific hedge type were ValX-ValY, I want to resolve that value, not just display that text.
Hopefully this makes sense.
Thanks,
Graham ...
