Coded Files (Stacked Columns)
It’s common to have source files with coded values which need to represent different columns in the output template.
For example:

The biggest difference is that we need a repeating part number column and some kind of code to indicate the type of data represented.
In the above example, “SHO” represents the “Short Description” and must be “pivoted” to the correct column in the output. Presumably, there would be one template variable (column) for each code provided.
The program supports this type of data source with two special template variable values, lookup:code and lookup:value.
For example:
Columns:
- { Heading: "PartNo", Format: "part" }
- { Heading: "Code", Format: "text", TemplateVariable: "lookup:code" }
- { Heading: "Description", Format: "text", TemplateVariable: "lookup:value"}
We then need a Code table to associate each lookup:code value to an actual template variable:
Codes:
- { Code: "DES", TemplateVariable: $LONG_DESCR }
- { Code: "EXT", TemplateVariable: $EXT_DESCR }
- { Code: "SHO", TemplateVariable: $SHORT_DESCR }
If you include more than one “lookup:code” column, they will be combined to form the code by concatenating the data in order separated by a hyphen.
So, for example, DES-EN to create an English Long Description. If a lookup code column is empty, the hyphen separator will
not be included (so you will never have a code with --).
Columns:
- { Heading: "PartNumber", Format: "part" }
- { Heading: "TypeCode", Format: "text", TemplateVariable: "lookup:code" }
- { Heading: "RecordNumber", Format: "text", TemplateVariable: "lookup:code" }
- { Heading: "LanguageCode", Format: "text", TemplateVariable: "lookup:code" }
- { Heading: "Content", Format: "text", TemplateVariable: "lookup:value"}
Codes:
- { Code: "SHO-EN", TemplateVariable: $SHORT_DESCR_EN }
- { Code: "SHO-ES", TemplateVariable: $SHORT_DESCR_ES }
- { Code: "FAB-1-EN", TemplateVariable: $FAB_1_EN }
- { Code: "FAB-2-EN", TemplateVariable: $FAB_2_EN }
- { Code: "FAB-3-EN", TemplateVariable: $FAB_3_EN }
See Sample1 for a working example of a coded data source.