Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Kohli
Creator II
Creator II

Crete a table with max values from existing table

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

 

Labels (1)
3 Replies
surendraj
Specialist
Specialist

Try like...
Aggr(max(tips),from)
sunny_talwar

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;
sasis551
Contributor III
Contributor III

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;