About EasyMorph Tutorials & Examples Web-help

Column name dynamic

Hi,

In actions such as rename column, calculate new column or modify column, it would be good to have a dynamic name of column (expression editor available) instead of a fixed name like today.

Can you give an idea about a use case for it?

Yes, 2 examples :

  • Imagine you want your project to compare 2 dates, with dates as parameters. You want columns with amount for date 1 and amount for date 2, and other columns depending on that dates. I mean column names are not always static

  • Imagine in your database your fields are always prefixed with the name of the table but at the end, you want the name without the prefix. It’s very difficult to do this with easymorph today, even if you can do it. We are in that case :slight_smile:

Hi Dimitry,

I would like to add to this. The majority of our data movement is 3rd party flat file to database. As you can imagine, our 3rd parties periodically make changes to the file layout or to column names, which can “break” some projects in EM. Easy example is changing case in a column name or adding a space to the end of a column name. We would like to be able to iterate column names into a module to use the sanitize text action, convert names to lower/uppercase, etc. We could then apply this module to all projects to ensure that 3rd party changes do not break our processes for the most part.

Thanks.

The new action “Rename Columns by Lookup” can do that I think : transformations:lookuprename [EasyMorph Help]

2 Likes

Yes! I actually just figured it out iterating column names from derive table metadata, running all of my actions and then doing a rename by lookup. It still would be useful to dynamically rename using a complex expression, but I am good or now!

Thanks.

To learn more about EasyMorph visit easymorph.com.