Location and Policy as shown in the sample data model below
in these I have 2 fields where is stored the currency locationPremiumCurrency and policyPremiumCUrrency.
The filed Currency target is the currency that the user wants to view the data. meaning that no matter the currency in the record, when the user selects USD, all the values will be displayed as USD. So this column (CurrencyTarget will be a filter object)
How can I remove the circular reference keeping the unique column?
Could I separate the tables and build a macro to connect the 2?
A loop is always a problem you can solve, always, if not, how would your brain understand the way your data process ?
I see a lot of fields used for this data model and a lot of names which are quite the same, what is the real difference between the CURRENCYRATES and PolicyCurrencyRates tables ? Why do you need the POLICY table if LOCATION table is already linked with currencytargets tables ?
step by step :
- do not load the fields you don't need
- describe us the link between the fact table and exchange rate,how the exchange rate is linked to it
Ok I understand your problem, you need to put both tables into only one table.
This script will do it (see below). And then in your app, when you want to multiply a measure by an exchange rate, you will have to choose on what "type" of exchange rate you want the measure to be. That way you only have one field currencytarget but your measures will choose the right "type" of currency.