0
votes

I have a Column (SALARY) in Source Table from Relational DB, for example 15000 is a record in SALARY column and I want to format it as $15,000.00 into the Target table which is a Relational DB using Expression Transformation.

Thankyou, Ajay

2
Why do you want to do it? Why not store numerical value in the database and then format it properly in the presentation layer? - Marek Grzenkowicz

2 Answers

0
votes

This can be done using below steps:

  1. Pull the required column from source to Expression transformation.

  2. Create a derived column as the concatenation of $ and the input column by making use of the equation CONCAT('$',Source_Column)

  3. Load this new column to the target, instead of the column from the source.

I hope this is just to learn the functionality. In real life scenarios, this is a bad practice. We need not keep these symbols and all in tables. This can be directly handled at reporting level.

0
votes

may be the scenario where salary column has salary of different types say 'dollor','euro','pounds', etc in same table. still i agree with Thomas Cherian that is not good practice to store the symbol with data itself.

if this is the scenario you can do 2 things.

--1.) add another column in table and store the value of type there or add another column which stores the conversion rate also.

--2.) convert all the values in once currency and store it without symbol.