Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello I need to find the maximum date field from multiple date fields
i need to put this in my script.
so for one order there will be different dates as it moves forward
i need to create one column which shows the latest date at that particular time.
order | date1 | date2 | date3 | max(date) |
1 | 1 | 1 | ||
1 | 1 | 2 | 2 | |
1 | 1 | 2 | 3 | 3 |
Please let me know how i can do it.
Thanks & Regards,
Jaya
LOAD
RangeMax(date1,date2,date3) as MaxDate
May be
RangeMax(date1, date2, date3)
=Max{1} Date
Hi Jaya,
I find it difficult to judge, why need place this in the script. But if it is necessary, as an variant
Table1:
LOAD
RowNo() as ID,
*Inline
[order,date1,date2,date3
1,1,
1,1,2
1,1,2,3];
Table2:
CrossTable (Date,Vol,2)
LOAD
ID as ID1,
order as order1,
date1 as date11,
date2 as date22,
date3 AS date33
Resident Table1;
Table3:
LOAD
ID1,
Max(Vol) as MaxDate
Resident Table2
Group By ID1;
DROP Table Table2;
Left Join(Table1)
LOAD
ID1 as ID,
MaxDate
Resident Table3;
DROP Table Table3;
Result
If the calculation can be done on the level of chart, colleagues above suggest solution.
Regards,
Andrey