Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have data like this:
date value
1/1/11 5
1/1/11 6
1/1/11 9
1/1/11 2
2/1/11 4
2/1/11 5
2/4/12 12
2/4/12 12
2/4/12 1
2/5/12 1
2/5/12 2
i need to make a table that for every date has the max value.
i want to do this in my load script.
thanks so much!!!
load
date,
max(value) as maxvalue
from table
group by date;
I guess that you want to find the max value, which is 12, and get the date where the value is 12.
tmp:
Load max(value) as MaxValue From yourtable;
LET vMaxValue=peek(MaxValue);
Drop table tmp;
Load date From yourtable
Where value = $(vMaxValue);
Regards,
Michael
try this
AB:
LOAD * INLINE [
date, value
1/1/11, 5
1/1/11, 6
1/1/11, 9
1/1/11, 2
2/1/11, 4
2/1/11, 5
2/4/12, 12
2/4/12, 12
2/4/12, 1
2/5/12, 1
];
LOAD date,max(value) as maxvalue
Resident AB
Group by date;
*********************************************************************
if you want the max value in value field for all date then try this.
load max(value) as max Resident AB;