Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
There is no straight forward way to achieve normalization on multiple columns. So, to achieve what you want the solution needs to be tweaked.
Job Layout -
The tMap is basically concatenating the different Quartern salesvolumen columns into one - Quarter & SalesVolume respectively.
row52.Quarter1 + ";" + row52.Quarter2 + ";" + row52.quarter3 + ";" + row52.quarter4 & row52.salesvolume1 + ";" + row52.salesvolume2 + ";" +row52.salesvolume3 + ";" + row52.salesvolume4
Once done pass them through tFlowToIterate so that your two rows are iterated separately and normalized accordingly. Once they are pushed to tJavaFlex the code would read them as once converted to array[] would iterate on each element and pass one row by row to output.
// start part of your Java code
String QuarterNames = (String)globalMap.get("out14.Quarter");
String SalesVolumes = (String)globalMap.get("out14.SalesVolume");
String[] quarterArray = QuarterNames.split(";");
String[] salesVolumeArray = SalesVolumes.split(";");
for( int i = 0; i < quarterArray.length; i++) {
// here is the main part of the component,
// a piece of code executed in the row
// loop
row56.stringid = out14.stringid;
row56.stringidentifier = out14.stringidentifier;
row56.Fiscalyear = out14.Fiscalyear;
row56.Quarter = quarterArray[i];
row56.SalesVolume = salesVolumeArray[i];
//System.out.println(quarterArray[i]);
// end of the component, outside/closing the loop
}
You could directly connect the tJavaFlex to your desired output component or if you want all of them to stored/displayed in a one shot then you could store them temporarily to tHashOutput and then read through tHashInput and display/write to the component (in my case tLogRow).
Simple solution
tFileInputDelimiter-->tMap-->tNormalize-->tMap-->tLogRow