Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
qliknonsense
Contributor
Contributor

LOAD with GROUP BY with MAX

Hey guys,

I have a problem with a load with group by:

LOAD

Year,

Month,

A,

max(B)

RESIDENT SomeOtherTable

GROUP BY Year, Month;

 

I want to group by Year and Month, and I want my A to show only in a case where B=max(B).

How can I achieve this?

1 Solution

Accepted Solutions
Kushal_Chawda

@qliknonsense  try below

SomeOtherTable:
LOAD
Year,
Month,
B
FROM table;

inner join(SomeOtherTable)
LOAD
Year,
Month,
max(B) as B
RESIDENT SomeOtherTable
GROUP BY Year,Month;

View solution in original post

1 Reply
Kushal_Chawda

@qliknonsense  try below

SomeOtherTable:
LOAD
Year,
Month,
B
FROM table;

inner join(SomeOtherTable)
LOAD
Year,
Month,
max(B) as B
RESIDENT SomeOtherTable
GROUP BY Year,Month;