This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
howtos:reading_data_into_arrays [2011/05/17 14:43] marcus.williams created |
howtos:reading_data_into_arrays [2011/05/25 13:42] marcus.williams |
||
---|---|---|---|
Line 1: | Line 1: | ||
Make distinction between //data informant// and //target informant// - refer to overview article. | Make distinction between //data informant// and //target informant// - refer to overview article. | ||
+ | |||
+ | There's amost always a mapping required; whether it's done in a TOOL script, a view or in the model. | ||
+ | |||
+ | Name data informants appropropriately (to indicate their strong data dependence) as opposed to target informats which tend to be more generic. E.g. use "_data" suffix for name, "_d" for index. | ||
+ | |||
+ | I usually tackle moderately complex imports in a stand alone TOOL script (not a view) kept alongside the source data, which produces a whatIf-friendly output (TOOL or text), along with informants. | ||
===== Case 1 - Data informant used in model diagram ===== | ===== Case 1 - Data informant used in model diagram ===== | ||
Line 5: | Line 11: | ||
Some situations in which this occurs: | Some situations in which this occurs: | ||
* Data informant and target informant are common (no mapping required). If the informant is defined in the diagram then the source data can be imported immediately; otherwise, the informant must be defined. | * Data informant and target informant are common (no mapping required). If the informant is defined in the diagram then the source data can be imported immediately; otherwise, the informant must be defined. | ||
- | * Data informant and target informant | + | * Data informant and target informant are different, therefore mapping occurs in diagram. |
- | There's amost always a mapping required; whether it's done in a TOOL script, a view or in the model. | + | ===== Case 2 - Data informant mapped to target informant in script/view ===== |
+ | |||
+ | Write and run script with this format: | ||
+ | <file> | ||
+ | Get informants from file | ||
+ | Export informants | ||
+ | </file> | ||
+ | |||
+ | Inspect informants, and create mappings. Grow script to: | ||
+ | <file> | ||
+ | Get informants from file | ||
+ | !Export informants (now optional) | ||
+ | Define mappings (from parameters or from external file) | ||
+ | Create/import data with data informants | ||
+ | Apply mappings | ||
+ | Export data | ||
+ | </file> | ||