About EasyMorph Tutorials & Examples Web-help

Parameterize column / dynamic column from string


#1

Is it possible to pass a column name as a parameter? I have a fairly complicated subroutine that I'd like to use the Call Project transformation on. The source dataset won't always have the same column names - although as a workaround I could add calculated columns to fit a certain schema. It would be useful I think to be able to eval a string and have it resolve to a column name.


#2

It's not possible yet. In version 3.6 we will have a transformation that selects only columns which names exist in another table. It will provide a bit of flexibility for column schemes.

Sometimes it makes sense to unpivot the table first, especially when the table is a matrix. In this case its columns become rows which makes data transformation more convenient. Later the result can be pivoted back, if needed.


#3

Agree this would be useful. I am running into this issue now. I am consuming data from arbitrary Excel files, and would like to set some parameters for important column names (for instance, what the name of the key column is so I can match it against a reference table).


#4

@jdavidhobbs,

take a look at the “Rename by lookup” transformation. You can use it to rename a column which name is specified by a parameter, to some generic name. Then do the matching.