Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a table :
Date | Call No | status
i want to load the min(date) of a perticular call no where status is 79 or 13...
Can any one help me to write the code for this
i tried this but it is not working
LOAD
min(Date) as MDate,
Call_no,
Status
FROM
Hi
Try like this
load min(Date) AS minDate,
Call_no,
Status
from filename.xls where match(Status,13,79) group by Call_no,Status;
Or you can try like this
Table1:
Load Call_no,Status,Date from filename.xls where match(Status,13,79);
Temp:
Inner join(Table1)
Load min(Date) as Date, Call_no resident Table1 group by Call_no;
Note:
Whenever u use aggregation please use group by clause..
From ur post i note down, after tempDate:
i think u forget to add load statement..please correct it that..
N one more thing..u must add all field in group by clause except using in aggregation function
Ex:
Load min(date),id,callno from tablename group by id,callno;
Hope it helps
Hi grace,
try this:
Table1:
LOAD
Date,
Call_no,
Status
FROM
TempMinDate:
min(Date) as MinDate
Resident Table1;
Hope this can help you.
Regards,
Heri
For every callno you can use group by, with this code:
Table1:
LOAD
Date,
Call_no,
Status
FROM
TempMinDate:
Call_no,
Statusas temp_status,
min(Date) as MinDate
Resident Table1
Group By Call_no;
It is giving error as
"Unknown statement"
TempMinDate:
min(Date) as MinDate
Resident Table1;
Did you have tried the second code that I provided using group by?
Regards,
Heri
Regards,
Heri
Business Intelligence Developer
PT. Evotech Distribusi
Ruko Garden Shopping Arcade Blok.C/09/AS
Jl. Podomoro Avenue, Podomoro City - Jakarta Barat
Phone: +62 21 569 823 85 / 86
Fax: +62 21 569 823 87
Mobile: +62 813 6463 7227
Email: heri@evotech.co.id
same error i am getting for both the code...
Can you copy paste your code? I want to see did it missed something or not. I tried in my computer, and it worked fine.
Thanks.
Regards,
Heri
Business Intelligence Developer
PT. Evotech Distribusi
Ruko Garden Shopping Arcade Blok.C/09/AS
Jl. Podomoro Avenue, Podomoro City - Jakarta Barat
Phone: +62 21 569 823 85 / 86
Fax: +62 21 569 823 87
Mobile: +62 813 6463 7227
Email: heri@evotech.co.id
Table1:
LOAD Date,
call_no,
Status
FROM
tempdate:
call_no,
status as temp_status,
min(Date) as MinDate
Resident Table1
group by call_no;
Try change 'status as temp_status' by 'Status as temp_status'..
Regards,
Heri
Business Intelligence Developer
PT. Evotech Distribusi
Ruko Garden Shopping Arcade Blok.C/09/AS
Jl. Podomoro Avenue, Podomoro City - Jakarta Barat
Phone: +62 21 569 823 85 / 86
Fax: +62 21 569 823 87
Mobile: +62 813 6463 7227
Email: heri@evotech.co.id
Hi
Try like this
load min(Date) AS minDate,
Call_no,
Status
from filename.xls where match(Status,13,79) group by Call_no,Status;
Or you can try like this
Table1:
Load Call_no,Status,Date from filename.xls where match(Status,13,79);
Temp:
Inner join(Table1)
Load min(Date) as Date, Call_no resident Table1 group by Call_no;
Note:
Whenever u use aggregation please use group by clause..
From ur post i note down, after tempDate:
i think u forget to add load statement..please correct it that..
N one more thing..u must add all field in group by clause except using in aggregation function
Ex:
Load min(date),id,callno from tablename group by id,callno;
Hope it helps