If the argument specified is the secondary or other sorted key, then LastRowInGroup() returns TRUE if the value of the specified column is about to change, or if any of its higher level of key columns are about to change. For example, if the primary sorted column is Col1 and the secondary sorted column is Col2, then LastRowInGroup(Col2) returns true when either the value in Col2 is about to change, or the value in Col1 is about to change. Therefore it can return true when Col2 is not about to change, but Col1 is, because Col1 is a higher level sorted key than Col2.
If the data is sorted on multiple columns and LastRowInGroup() is applied to secondary sort column how will transfomer know which is the primary sort column unless specified as an argument as to what is the sort hierarchy of columns ?
I don't have any internal knowledge as to how that function is coded, but presumably it is smart enough to "see" the last upstream tsort operator and the sort order that was specified therein.
The data must be sorted in the job, so that the Transformer stage can detect that it is sorted. If the data is sorted before being input to the job, you can include a dummy Sort stage and set the stage's Sort Key property to Don't Sort (previously sorted) for every column on which the data was previously sorted.
Just confirms the what, the how would be some IBM secret sauce.
-craig
"You can never have too many knives" -- Logan Nine Fingers
Then, as noted in the docs, you'll have to specifiy how it is sorted "so that the Transformer stage can detect that it is sorted". And as noted that would be via a Sort stage set to "Don't Sort".
-craig
"You can never have too many knives" -- Logan Nine Fingers