Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I think below row is also wrong in your "Result should be":
201801 b1 90
it should be :
201801 b1 100
And there is an easy way to solve that, or you can use loop.
Easy way:
t1: LOAD * INLINE [ Col A, Col B, Col C 201801, b1, 100 201801, b2, 60 201801, max, 30 201802, b1, 160 201802, b2, 120 201802, max, 40 ]; Left Join LOAD [Col A], [Col C] as [max Col C] Resident t1 Where [Col B] = 'max'; Concatenate LOAD [Col A], [Col B] & '/max' as [Col B], Div([Col C],[max Col C]) as [Col C] Resident t1 Where [Col B] <> 'max'; DROP Field [max Col C];
Please try, it works in my desktop.
Aiolos Zhao