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: 
segerchr
Contributor III
Contributor III

Load with distinct and max

Hey, i am searching for a possibility to aggregate data within the distinct command. I want to have just a distinct "mac" and the highest number. Could somebody help to make this possible? 

 

table1: 

load * inline [

mac, number 

aab1,5

aab1,2

ccde,1

ddee,2

];

 

I expect the following table:

aab1,5

ccde,1

ddee,2

 

Thanks

3 Replies
pradosh_thakur
Master II
Master II

table1:

LOAD mac, max(number) as number

group by mac;

load * inline [

mac, number

aab1,5

aab1,2

ccde,1

ddee,2

];

Learning never stops.
segerchr
Contributor III
Contributor III
Author

Thanks for your solution. It works fine with two columns. I will do it a little more complicated. I have additional text, after the max(number)... Do you have also a solution for that ?

 

table1: 

load * inline [

mac, number, Text

aab1,5, This is five

aab1,2, This is two

ccde,1, This is one

ddee,2, This is two

];

 

I expect the following table:

aab1,5, This is five

ccde,1, This is one

ddee,2, This is two

 

 

pradosh_thakur
Master II
Master II

table123:

load * inline [
mac,number,Text
aab1,5,This is five
aab1,2,This is two
ccde,1,This is one
ddee,2,This is two
];

inner join

LOAD mac, max(number) as number //,text(Text) as Text

Resident table123

group by mac;

Learning never stops.