Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Please help me find the max and min value of each month in a straight table.
aggr(max(price),month) gives the max value correctly. But the corresponding item appears incorrectly. Even tried using firstsortedvalue.
Sales:
Load * Inline
[item, month, price
Carrot, Jan, 150
Beans, Jan, 90
Onion, Jan, 40
Brinjal, Feb, 60
Carrot, Feb, 130
Onion, Feb, 50
Beans, Mar, 100];
I wud like to see the results as follows in a straight table or 2 diff tables (one for max and one for min)
Month Maxprice Item Minprice Item
Jan 150 carrot 40 Onion
Used firstsortedvalue(), please find attached.
Hope this helps!