Beruflich Dokumente
Kultur Dokumente
The mapping shown above is the earlier mapping which concatenated all the skill Input port values
in the EMP_SKILL_OUT Output port in the EXP_CONCAT_SKILLS Expression Transformation. The
expression used in the EMP_SKILL_OUT port is shown below.
The issue surfaced after the data was loaded in the target table. Below are the records loaded into
the EMPLOYEE_SKILL_SUMMARY table.
Now, the EMP_SKILLS field was displayed in some analytical reports and the way the data showed
up didnt look very pleasing. For instance, EMP_ID = 1199 has no skills in the EMPLOYEE_SKILLS
source table, so when the three input port values were concatenated in the expression
transformation, the data displayed in the reports was ',,'. So, a logic needed to be implemented that
took care of NULL values and didnt add a comma for the NULL values.
Now, the only problem of a comma occurring at the end of the concatenated string will be in a
scenario when EMP_SKILL2_IN and EMP_SKILL3_IN values are NULL or when EMP_SKILL3_IN
values is NULL. For instance, if we observe in the source table EMPLOYEE_SKILLS, for EMP_ID =
1127, the EMP_SKILL1 and EMP_SKILL2 columns have valid data. So, for this particular record, the
EMP_SKILLS_CONCAT_V port will have the string value as SQL Server 2005,OBIEE 10.1.3.4,. At
the end of the string, the extra comma gets added as well.
To eliminate this comma, the string in the variable port EMP_SKILLS_CONCAT_V is reversed in
the variable port EMP_SKILLS_REVERSE_V. The EMP_SKILLS_REMOVE_COMMA_V variable
port will check for the occurrence of a comma at the start of the data string. If it encounters a
comma, it will pass only the substring without the comma at the start of the string, else it passes the
data as it is. This is achieved with the expression as shown below.
Now, to get back the original concatenated string without any extra comma , reverse the data again
and pass it through the EMP_SKILLS_OUT output port to the final target table column
EMP_SKILLS.
These are the records in the EMPLOYEE_SKILL_SUMMARY table after running the modified
mapping again.