Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Populate min value

Status
Not open for further replies.

bandarna

Programmer
Jan 2, 2003
122
US
I have a problem similar to like this, emp_source table with column names empno,ename,sal,hiredate and I have emp_target table with column names empno,ename,sal,hiredate,min_hiredate.


empno, ename, sal, hiredate are directly mapped with source to target table. I wanted to populate min_hiredate. I want to pic a minimum hiredate from my source and populate into all columns into target table. For eg: if a min hiredate is 11/26/1999 then I want to populate all columns of target table for all rows.

Thanks for any help.
 
Very simply use a dummy-join to get this done.

Fetch the value min_hire date (use a custom view or another mapping) and add an additional port that stores a dummy value (like 'x') Now add this dummy value to the flow that handles the other data. Use a joiner on the dummy ports and every row of the real data will now have the min_hire date as an additional column.

It is a bit of a lame solution, but one that works

T. Blom
Information analyst
tbl@shimano-eu.com
 
Here is another workflow. Check if it serves your purpose.



Source - > SQ - > Agg
Joiner - > Target
Source - > SQ - > Exp

In words..

Have two SQ for the source so that you have two separate pipelines.. Now in the Agg Trans have Hire Date and compute Min(Hire Date).. Add a dummy port say Dummy and put the value as 1.

Onto the second pipeline drag all the ports from SQ to Exp Transformation and again add a dummy port say Dummy1 with the value of 1. The reason for adding Dummy ports is basically to do the Join in the Joiner Trans. Now drag all these to the joiner and define the join as

Dummy = Dummy1 and map it to the target.

Further assistance drop a note.

Sri
 
Sri

I already have a Source - > SQ -> Exp, which is populating all other columns, there are some exp and lkp are already using before reaching to the target.

Now how can I use second time same source for agg. Can I use same SQ for both agg and exp and then use joiner before sending to target?


Narsimha B
 
You have two options. Drag the same source from the Source Instances onto your mapping and you will have a new pipeline. Another way insert a SQ Trans and it will ask for the Source and select the same source as used for

Source - > SQ - > Exp

Sri
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top