Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi I am using the follwing script to concatenate two tables coming from two qvds.. but it is not working..
Anybody cal tell me what's wrong?
Thxs
PhoneCalls:
Load
1 AS FactType,
OriginalParty,
CostCenter As EMPLOYEENUMBER,
Name As WWName,
Department,
Manager As ManagerName,
Division
from ..\QVD\Whowho.qvd(qvd);
CONCATENATE (PhoneCalls)
Load
2 AS FactType,
OriginalParty,
CallID,
FinalParty As NUMBERCALLED,
DurationPerMin AS DURATION,
TimeStamp,
floor(TimeStamp) AS CALLDATE,
TimeStamp - Floor(TimeStamp) AS TIME,
If((Month(floor(TimeStamp))*1=1),7,
If((Month(floor(TimeStamp))*1=2),8,
If((Month(floor(TimeStamp))*1=3),9,
If((Month(floor(TimeStamp))*1=4),10,
If((Month(floor(TimeStamp))*1=5),11,
If((Month(floor(TimeStamp))*1=6),12,
If((Month(floor(TimeStamp))*1=7),1,
If((Month(floor(TimeStamp))*1=8),2,
If((Month(floor(TimeStamp))*1=9),3,
If((Month(floor(TimeStamp))*1=10),4,
If((Month(floor(TimeStamp))*1=11),5,
If((Month(floor(TimeStamp))*1=12),6,Month(floor(TimeStamp)))))))))))))) AS MONTH,
If((Month(floor(TimeStamp))*1=1),Year(floor(TimeStamp)),
If((Month(floor(TimeStamp))*1=2),Year(floor(TimeStamp)),
If((Month(floor(TimeStamp))*1=3),Year(floor(TimeStamp)),
If((Month(floor(TimeStamp))*1=4),Year(floor(TimeStamp)),
If((Month(floor(TimeStamp))*1=5),Year(floor(TimeStamp)),
If((Month(floor(TimeStamp))*1=6),Year(floor(TimeStamp)),
If((Month(floor(TimeStamp))*1=7),Year(floor(TimeStamp))+1,
If((Month(floor(TimeStamp))*1=8),Year(floor(TimeStamp))+1,
If((Month(floor(TimeStamp))*1=9),Year(floor(TimeStamp))+1,
If((Month(floor(TimeStamp))*1=10),Year(floor(TimeStamp))+1,
If((Month(floor(TimeStamp))*1=11),Year(floor(TimeStamp))+1,
If((Month(floor(TimeStamp))*1=12),Year(floor(TimeStamp))+1,Year(floor(TimeStamp)))))))))))))) AS SALESYEAR
from ..\QVD\CDRLog.qvd(qvd);
Hi,
Can you explain a little more?
Because I want to know what is actual requirement to concatenate these qvds ?
and what is the exact issue you are facing in this method?
However, I ll suggest you to go for joins rather than concatenating these tables.
Because joins will also give you the same columns which you shown in the image.
Try to do the left join either by FactType or OriginalParty.
Hope this helps
Regards
Andrew Hudson
Not answering your question, but it pains me to see how you create MONTH and SALESYEAR fields. There are many better ways, for example this:
if(month(TimeStamp)<=6, month(TimeStamp)+6, month(TimeStamp)-6) as MONTH
if(month(TimeStamp)<=6, year(TimeStamp), year(TimeStamp)+1) as SALESYEAR
Based on the PNG you posted, it looks like the data is concatenating into a single table. Could you be more specific about what you mean by "not working"?
-Rob