I think this is a feature request, because I haven't seen anything in the docs or in the community that indicates it's possible within the current version of easymorph. It's basically community topic Dynamic Transformation on steroids.
Use case
We need to import tables from SAP DaRT. They are many (200) and they are large (GB). DaRT files come in pairs: tab-separated data files and XML metadata files.
Required functionality
I need to apply the correct data type per column. For select data types, some pre-processing is required, e.g. for dates, 00.00.0000 needs to be replaced with NULL and for years 0000 needs to be replaced with NULL. This pre-processing and the column data type conversion needs to be performed dynamically (I'm not going to manually define the conversions for 200 tables, especially because the information is already available).
Workaround attempt 1 (9.4 KB)
- parse metadata XML
- derive metadata table per data type (row value filter)
- derive data table with only columns of a specific data type (Select columns by lookup)
- apply data conversion logic to these groups of columns
- merge them back together
Issues:
- the merge requires a key for linking the tables back together
- adding such a key introduces a column that should be exempt from the data conversion. There is no way to specify that logic should apply to "all columns except ..."
Workaround hack 2 (9.9 KB)
- parse metadata XML
- reduce metadata to two columns: column name, and combined metadata spec (e.g. "DATS:000008:")
- pivot the metadata, and append the data so that the metadata resides in the first row
- iterate over the columns
in a module that
- extracts the first row as a derived table
- has derived tables for each data type, with a "Skip on condition in another table" to generate an empty result if the data type does not apply
- merges the derived tables using a series of "Either table" actions
That works, but is there (or should there be) a less hack-ish way to solve this?