the answer to your first question depends on the fact whether you would need to calculate subtotals. In other words, if there was the level 1, level 11 and a new level 111, the question would be whether you intend to calculate a subtotal amount for the level 11 as well. If the answer is yes, then, as you rightly said, you will have to add another Reformat component in between SimpleCopy and Concatenate and change the code respectively. For example:
Code: Select all
$out.0.Cost = charAt($in.0.Cost,0) + charAt($in.0.Cost,1);
If the $in.0.Cost field equals “123”, the code above would basically output “12” to the $out.0.Cost field.
Note: I am still assuming that the total value of a parent level COD cost is always a sum of its child level COD Costs and that there is never a standalone expense value for any of the parent levels.
As far as your second question is concerned, the answer depends on the fact whether you need to account for the date in your results (e.g. calculate subtotals for date ranges etc.). If not, you would only need to read the data from the flat file properly which means you would need to change your input reading metadata to account for the date (including the respective format).