Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
in this case:
costs:
Load *Inline [
dataCost , costAmount
'01/07/2009' , 10000
'01/08/2009' ,50000
];
load
Max(date(date#(dataCost, 'DD/MM/YYYY'))) as endPeriod ,
costAmount
resident
costs
group by dataCost, costAmount ;
endPeriod outpi = '01/07/2009' and 01/08/2009
nothing happens? return 2 date and not the max date 01/08/2009
I would obtain HUSt a max date = 01/08/2009
please help me.
thanks, best regards
Sl
Try
group by costAmount
it doesn't work r.
return 2 date and i aspect 1 date the max and so 01/08/2009 ...
Hi,
you need to calculate the max. value and then join it across all records.
Second part of the script should read:
JOIN (costs) load
Max(date(date#(dataCost, 'DD/MM/YYYY'))) as endPeriod
resident
costs;
HTH
Peter
Sure, what I was thinking...
It returns max per each costAmount. You need simply
load
Max(date(date#(dataCost, 'DD/MM/YYYY'))) as endPeriod
resident cost;
ok, now works please O f I would to convert this field endPeriod to a variable is it possible?
Thanks
Slasj
Hi,
would be a construct like
MaxTable: LOAD MAX(YourDate) AS MaxDate RESIDENT YourTable;
LET vMax = PEEK('MaxDate', 0, 'MaxTable');
HTH
Peter
Yes:
LET vEndPeriod = peek('endPeriod');
And, after this you can drop the field, if you use Peter's approach, or the table where the field is, if you use mine.
Thaks at All
Best Regards
Slash