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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
DestinedTale
Contributor II
Contributor II

Qlikview to keep record based on second field

Hi, I encounter an issue where below will display two records, one duplicate as the max(money) has two identical data. 

How do I keep data based on the MAX_LOVE on two records where MAX_LOVE value is higher. 

 

A
load
YearMonth,
Id,
Max(MONEY)as MAX_MONEY

NoConcatenate
A:
load
YearMonth,
Id,
MAX_MONEY &' , '& MAX_LOVE as RICHEST

Labels (1)
1 Reply
Chanty4u
MVP
MVP

Try this 

A:

LOAD

    YearMonth,

    Id,

    MAX(MONEY) as MAX_MONEY,

    MAX(LOVE) as MAX_LOVE

RESIDENT <table_name>

GROUP BY YearMonth, Id;

 

B:

LOAD

    YearMonth,

    Id,

    FIRSTSORTEDVALUE(RICHEST, -MAX_MONEY, -MAX_LOVE) as RICHEST

RESIDENT A

GROUP BY YearMonth, Id;