Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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;