How to deal with NULL or deleted (numeric) values?
Sometime the values from the source database turn into NULL values. There are two (or more) ways how to deal with this:
A. You can convert the value to zero before it is inserted in the Anchor Model
B. You can insert NULL values in the Anchor Model
Option 'B' is not possible.
Option 'A' looks correct, but sometimes NULL values serve a specific meaning in the database.
The AVG function is an example of that (see the example below).
What is the best way in order to deal with numeric values (or other values) that are deleted or turn into NULL. Without converting the complete Anchor Model database to BI-temporal and use the ErasedAt attribute for evey historic attribute.
Re: How to deal with NULL or deleted (numeric) values?
As you may have guessed, we don't like null values. If you change a column to allow nulls and do B) "insert a NULL value" you can no longer tell the difference between missing data and a semantic NULL in your views, for example the latest view.
I would say you have two options in monotemporal AM:
1) Delete the row in your AM if it becomes NULL in the source.
2) Encode that which NULL represents in its own attribute.
For example, a BudgetIsSet attribute, and if you need to calculate an average only include those rows where BudgetIsSet = 'true', but if you need to count budgeted items, then all rows may be desired.