Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I've got a table WORKORDER:
ID_W
ID_GROUP
IS_OPENED (Boolean)
DATE
I'd like to get the first date that is still opened by ID_GROUP
May be Can I use Previous or Peek ? I dont know really.
Regards.
DAAM
Try this:
MinDate:
Load ID_GROUP, min(DATE) as MIN_DATE
Resident WORKORDER
Where IS_OPENED = 1
Group By ID_GROUP;
If you don't want the minimum date but simply the first date value encountered you can use FirstValue(DATE) instead of min(DATE).
In the script?
Max:
Load Max(Date) as MaxDate FROM <> where IS_OPEN='Y'; // or may be IS_OPEN='1'
Let vMaxdate = Peek('MaxDate') ; // now the variable holds the max date
Drop table Max;
Try this:
MinDate:
Load ID_GROUP, min(DATE) as MIN_DATE
Resident WORKORDER
Where IS_OPENED = 1
Group By ID_GROUP;
If you don't want the minimum date but simply the first date value encountered you can use FirstValue(DATE) instead of min(DATE).
Hi
Try with firstvalue() function to get the first value for id group.
Load ID_GROUP, FirstValue(DATE) as MIN_DATE
Resident WORKORDER
Where IS_OPENED = 1
Group By ID_GROUP;
Hi Thank
I used First Value
Regards