Skip to main content
Solved

How to create a transformation that is different for each mapping going to the same table

  • December 20, 2019
  • 5 replies
  • 33 views

Example scenario:

Table DimProject has 2 mappings, each from a different source:

Mapping 1 = SourceA.Project

Mapping 2 = SourceB.Project

Now both systems will have the same project number with different meanings.

My question is how do I make a transformation that returns 'A' + [project number] in mapping 1 and 'B' + [project number] in mapping 2.

The solution needs be rely on explicitly meaningful conditions, no implicit conditions that drive people crazy trying to decipher what they are for somewhere in the future.

Any ideas?

Best answer by JTreadwell

 

Hi Steven, thanks for posting. This is a very common need that has a few possible solutions. 

If the two tables are from different sources then something like this would work:

If the two table mappings happen to come from the same source. Then you will need to create the field w/ a fixed transformation in the ODX/staging table. If the ODX/staging is in Simple mode you can do one of the following: 

  1. Disable simple mode only on the tables where you need to add the transformations. This can be done in table settings. 
  2. Create a view of the table and create the field & transformation there. Then map the view into the DSA. 

Does that make sense? 

View original
Did this topic help you find an answer to your question?

5 replies

Hi Steven.

If the source tables are coming from different sources, you could do the condition on the DW_SourceCode.

If the DW_SourceCode is the same - both tables are coming from the same Source - you could create an indicator on the delivering tables (a field called eg. SourceTable), fill it with 1 the first table and fill it with 2 on the second table. On the receiving table move the fields from the sourcetables to the same field and create the condition from this.

Regards JJ


Thanks for your suggestion! I'm keeping my fingers crossed for a solution that does not hit the source table :) 

I know there is a feature request for an actual system field DW_SourceTable but I think this area of features is more complex than most people need so it doesn't generate enough attention to make the roadmap.


andri
Contributor
Forum|alt.badge.img+1
  • Contributor
  • 37 replies
  • December 20, 2019

I've also had this issue and have used a custom field in each source table with a fixed value. That's an issue when you're mapping from an ODX that is in simple mode. 

If we were able to create a condition based on the source mapping it would allow us to create a conditional fixed value to solve this.


JTreadwell
Employee
Forum|alt.badge.img+5
  • Employee
  • 179 replies
  • Answer
  • December 21, 2019

 

Hi Steven, thanks for posting. This is a very common need that has a few possible solutions. 

If the two tables are from different sources then something like this would work:

If the two table mappings happen to come from the same source. Then you will need to create the field w/ a fixed transformation in the ODX/staging table. If the ODX/staging is in Simple mode you can do one of the following: 

  1. Disable simple mode only on the tables where you need to add the transformations. This can be done in table settings. 
  2. Create a view of the table and create the field & transformation there. Then map the view into the DSA. 

Does that make sense? 


peter.jensen
TimeXtender Xpert
Forum|alt.badge.img+2
  • TimeXtender Xpert
  • 41 replies
  • January 7, 2020

Another solution is to create 2 query tables in which you add an extra column.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings