It is hard to explain this in word, so sorry if the title is mismatch.
So I have a file text like this:
Header A Header B Header C Header D
Apple Red A 100
B 200
B 300
Green A 400
B 500
Eggplant Purple A 600
B 700
White a 800
And I want it to be read like this:
Header A Header B Header C Header D
Apple Red A 100
Apple Red B 200
Apple Red B 300
Apple Green A 400
Apple Green B 500
Eggplant Purple A 600
Eggplant Purple B 700
Eggplant White a 800
But I confuse what transformation that I have to use.
So how to get this result in Pentaho? Or is there video tutorial I have to watch?
Thanks Before.
I have try transformation "If Value is null" and "Filter Rows", but it’s doesn’t seems the solution.
2
Answers
Please try one of this solutions.
I don t use Postgresql but i m confident that this solutions will work also in Postgresql with small changes for exemple top 1 with limit 1 at the end.
If you have further questions or is something which you don t understand please ask me.
Do not use that update after the first solution if not the case.
You can use the Modified JavaScript Value step.
You create two new columns, AltHeaderA and AltHeaderB (or you could rewrite HeaderA and HeaderB columns, but I like keeping the original values for clarity when debugging.
In the script, you just put: