As mentioned by Syed, you can use following code in a custom field transformation.
ROW_NUMBER() OVER (PARTITION BY [OrderId] ORDER BY [DW_TimeStamp] ASC)
But please note, that there is one caveat with this solution. The field transformation is only applied in your transformation-view. This mean that, IF you have a table with an incremental load, you will only have this logic applied to whatever data you have in your "raw-table".
If your Jounalbatch data is inserted from many incremental loads, this logic will not work.
One option, in that case, would be adding a post-script (post data-cleansing) to your table, which updates all the id's in your raw-table. This could look like this:
UPDATE sh1
SET sh1.[Row]=sh2.[Row] --Update rownumber in valid-table
FROM [etl].[Sheet1] sh1
INNER JOIN ( --join row-number
SELECT
a.[DW_Id]
,ROW_NUMBER() OVER (PARTITION BY a.[OrdeId] ORDER BY a.[SCD From DateTime] ASC) AS [Row] --fetch RowNo
FROM [etl].[Sheet1] a
WHERE EXISTS ( --limit id's from valid table, to whatever found in raw-table
SELECT b.[Id]
FROM [etl].[Sheet1_R] b
WHERE a.[Id]=b.[Id]
)
) sh2 ON sh1.[DW_Id]=sh2.[DW_Id]
If you only have a limited no of rows, this solution would be slightly overkill. But if you need something to perform on an incremental load, this would be my best guess.
PS: Remember to add an index on the Id-field (in my case "OrderId")
//Martin