Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have table like
From, To, Tips, Month
Del, Mub, 5, Jan
Del, Mub, 6, Feb
Del, Mub, 3, Mar
Del, Mub, 2, Apr
Blr, Del, 9, Jan
Blr, Del, 4, Feb
Blr, Del, 6, mar
Blr, Del, 5, Apr;
I want output like
From, To, Tips, Month
Del, Mub, 6, Feb
Blr, Del, 9, Jan
Try this
Table: LOAD *, From&To as FromToKey; LOAD * INLINE [ From, To, Tips, Month Del, Mub, 5, Jan Del, Mub, 6, Feb Del, Mub, 3, Mar Del, Mub, 2, Apr Blr, Del, 9, Jan Blr, Del, 4, Feb Blr, Del, 6, mar Blr, Del, 5, Apr; ]; MaxTips: LOAD FromToKey, Max(Tips) as MaxTips, FirstSortedValue(Month, -Tips) as MaxTipMonth Resident Table Group By FromToKey;
Hi,
try below script once.
Table1:
LOAD *,
From&'-'&To as [From-To-MonthKey];
LOAD * INLINE [
From, To, Tips, Month
Del, Mub, 5, Jan
Del, Mub, 6, Feb
Del, Mub, 3, Mar
Del, Mub, 2, Apr
Blr, Del, 9, Jan
Blr, Del, 4, Feb
Blr, Del, 6, mar
Blr, Del, 5, Apr;
];
NoConcatenate
Table2:load [From-To-MonthKey],max(Tips)Resident Table1 Group by [From-To-MonthKey];
exit script;