Update values in the ETL from an idpadre

0

I am using Pentaho 4.3 to make the following transformation: From an excel that contains data on Municipalities and Popular Councils I must insert in my BD the popular advice. The municipalities have already been added before. A municipality has several popular councils. In the excel the Municipalities appear with their popular councils in the following way: The column Mcpio-ConsejoP brings them both and they differ in that if it is a municipality the father of the column with this name is the same as its number, whereas if it is popular advice the idpadre is that of the municipality to which it belongs. Here I illustrate with an image:

Here comes my question, if from my BD I can get the iddpt that the Municipalities have in the real DB, and I want to put them as iddpt to their children too, is it possible to do that with Pentaho? Thank you!

    
asked by Alberto Blanco Cala 26.04.2018 в 18:03
source

1 answer

0

It occurs to me: 1.- Create a reference table with idpadre and iddpt. 2.- Then, in another transformation you add an "input table" with the data from the reference table created in (1) and "Microsoft Excel input" that brings the data of all the municipalities. Then you use a "Stream value lookup" to add the "iddpt" to the data that comes from the "Microsoft Excel input". 2.- In the (2) you will have two columns iddpt, but to solve it I would use "select rename value" I eliminate with this the first "iddpt" (It is the one that would have the data blank) and only left the last one that would contain all the spaces full.

PS: As a recommendation, the reference table would leave it with a transformation so that it is updated every time you run the JOB, so that the data of the second transformation will always be updated.

    
answered by 09.05.2018 в 15:38