码迷,mamicode.com
首页 > 其他好文 > 详细

QLIKVIEW-SALESORDER\DELIVERYNOTICE\OUTSTOCK\INVOICE

时间:2019-10-17 14:13:25      阅读:86      评论:0      收藏:0      [点我收藏+]

标签:promise   creat   create   销售订单   tocken   ber   ide   group   seq   

//销售订单
SALESORDER_TMP:
NoConcatenate
LOAD T_SAL_ORDER.LE_ID,
[T_SAL_ORDER.LCY CODE],
T_SAL_ORDER.SYSTEM,
T_SAL_ORDER.#DataDateTime,
T_SAL_ORDER.#DataDate,
T_SAL_ORDER.FID as FID,
T_SAL_ORDER.FBILLNO AS SalesLineDailyOutstanding.process_id,
date(num#( T_SAL_ORDER.FCREATEDATE, ‘#.##0,0‘, ‘,‘, ‘.‘)) AS SalesLineDailyOutstanding.order_date,
T_SAL_ORDER.FCUSTID as FCUSTID,
T_SAL_ORDER.FSALERID AS FSALERID
FROM
[D:\1礼海电气\QILKVIEW\QLIKVIEW\SalesOrderDailyOutstanding\T_SAL_ORDER.qvd]
(qvd);
Inner JOIN
LOAD T_SAL_ORDERENTRY.LE_ID,
[T_SAL_ORDERENTRY.LCY CODE],
T_SAL_ORDERENTRY.SYSTEM,
T_SAL_ORDERENTRY.#DataDateTime,
T_SAL_ORDERENTRY.#DataDate,
T_SAL_ORDERENTRY.FID AS FID,
T_SAL_ORDERENTRY.FENTRYID AS FDDENTRYID,
date(num#(T_SAL_ORDERENTRY.FPLANDELIVERYDATE, ‘#.##0,0‘, ‘,‘, ‘.‘)) AS SalesLineDailyOutstanding.Shipment_Date,
T_SAL_ORDERENTRY.FMATERIALID AS FMATERIALID ,
num#(T_SAL_ORDERENTRY.FQTY, ‘####,##‘, ‘,‘, ‘.‘) AS SalesLineDailyOutstanding.qty,
T_SAL_ORDERENTRY.FSEQ AS SalesLineDailyOutstanding.process_pos_nr
FROM
[D:\1礼海电气\QILKVIEW\QLIKVIEW\SalesOrderDailyOutstanding\T_SAL_ORDERENTRY.qvd]
(qvd);
Inner Join
LOAD T_SAL_ORDERENTRY_D.LE_ID,
[T_SAL_ORDERENTRY_D.LCY CODE],
T_SAL_ORDERENTRY_D.SYSTEM,
T_SAL_ORDERENTRY_D.#DataDateTime,
T_SAL_ORDERENTRY_D.#DataDate,
T_SAL_ORDERENTRY_D.FENTRYID AS FDDENTRYID,
T_SAL_ORDERENTRY_D.FDELIVERYDATE AS FDELIVERYDATE,
date(num#(T_SAL_ORDERENTRY_D.FDELIVERYDATE, ‘#.##0,0‘, ‘,‘, ‘.‘)) AS SalesLineDailyOutstanding.promised_delivery_date
FROM
[D:\1礼海电气\QILKVIEW\QLIKVIEW\SalesOrderDailyOutstanding\T_SAL_ORDERENTRY_D.qvd]
(qvd);

Inner Join
LOAD T_SAL_ORDERFIN.LE_ID,
[T_SAL_ORDERFIN.LCY CODE],
T_SAL_ORDERFIN.SYSTEM,
T_SAL_ORDERFIN.#DataDateTime,
T_SAL_ORDERFIN.#DataDate,
T_SAL_ORDERFIN.FID AS FID,
T_SAL_ORDERFIN.FSETTLECURRID as FSETTLECURRID,
num#(T_SAL_ORDERFIN.FEXCHANGERATE, ‘####,##‘, ‘,‘, ‘.‘) AS FEXCHANGERATE
FROM
[D:\1礼海电气\QILKVIEW\QLIKVIEW\SalesOrderDailyOutstanding\T_SAL_ORDERFIN.qvd]
(qvd);


Inner Join
LOAD T_SAL_ORDERENTRY_F.LE_ID,
[T_SAL_ORDERENTRY_F.LCY CODE],
T_SAL_ORDERENTRY_F.SYSTEM,
T_SAL_ORDERENTRY_F.#DataDateTime,
T_SAL_ORDERENTRY_F.#DataDate,
T_SAL_ORDERENTRY_F.FENTRYID AS FDDENTRYID,
num#(T_SAL_ORDERENTRY_F.FALLAMOUNT, ‘####,##‘, ‘,‘, ‘.‘) AS SOFALLAMOUNT,
num#(T_SAL_ORDERENTRY_F.FTAXPRICE, ‘####,##‘, ‘,‘, ‘.‘) AS FTAXPRICE,
num#(T_SAL_ORDERENTRY_F.FAMOUNT, ‘####,##‘, ‘,‘, ‘.‘) AS SalesLineDailyOutstanding.Original.Amount
FROM
[D:\1礼海电气\QILKVIEW\QLIKVIEW\SalesOrderDailyOutstanding\T_SAL_ORDERENTRY_F.qvd]
(qvd);


Inner Join
LOAD T_BD_CURRENCY.LE_ID,
[T_BD_CURRENCY.LCY CODE],
T_BD_CURRENCY.SYSTEM,
T_BD_CURRENCY.#DataDateTime,
T_BD_CURRENCY.#DataDate,
T_BD_CURRENCY.FCURRENCYID AS FSETTLECURRID,
T_BD_CURRENCY.FNUMBER AS SalesLineDailyOutstanding.currency,
T_BD_CURRENCY.FCODE AS SalesLineDailyOutstanding.Original.Currency.Code
FROM
[D:\1礼海电气\QILKVIEW\QLIKVIEW\SalesOrderDailyOutstanding\T_BD_CURRENCY.qvd]
(qvd);
Inner Join
LOAD T_BD_MATERIAL.LE_ID,
[T_BD_MATERIAL.LCY CODE],
T_BD_MATERIAL.SYSTEM,
T_BD_MATERIAL.#DataDateTime,
T_BD_MATERIAL.#DataDate,
T_BD_MATERIAL.FMATERIALID AS FMATERIALID,
T_BD_MATERIAL.FNUMBER AS SalesLineDailyOutstanding.article.id
FROM
[D:\1礼海电气\QILKVIEW\QLIKVIEW\SalesOrderDailyOutstanding\T_BD_MATERIAL.qvd]
(qvd);

Inner Join
LOAD T_BD_CUSTOMER.LE_ID,
[T_BD_CUSTOMER.LCY CODE],
T_BD_CUSTOMER.SYSTEM,
T_BD_CUSTOMER.#DataDateTime,
T_BD_CUSTOMER.#DataDate,
T_BD_CUSTOMER.FCUSTID AS FCUSTID,
T_BD_CUSTOMER.FPROVINCIAL AS FPROVINCIAL,
T_BD_CUSTOMER.FNUMBER AS SalesLineDailyOutstanding.customer.id
FROM
[D:\1礼海电气\QILKVIEW\QLIKVIEW\SalesOrderDailyOutstanding\T_BD_CUSTOMER.qvd]
(qvd);
Inner Join
LOAD T_BAS_ASSISTANTDATAENTRY.LE_ID,
[T_BAS_ASSISTANTDATAENTRY.LCY CODE],
T_BAS_ASSISTANTDATAENTRY.SYSTEM,
T_BAS_ASSISTANTDATAENTRY.#DataDateTime,
T_BAS_ASSISTANTDATAENTRY.#DataDate,
T_BAS_ASSISTANTDATAENTRY.FENTRYID AS FPROVINCIAL,
T_BAS_ASSISTANTDATAENTRY.F_LHLRZX AS F_LHLRZX
FROM
[D:\1礼海电气\QILKVIEW\QLIKVIEW\SalesOrderDailyOutstanding\T_BAS_ASSISTANTDATAENTRY.qvd]
(qvd);
Inner Join
LOAD PBNQ_t_Cust100019.LE_ID,
[PBNQ_t_Cust100019.LCY CODE],
PBNQ_t_Cust100019.SYSTEM,
PBNQ_t_Cust100019.#DataDateTime,
PBNQ_t_Cust100019.#DataDate,
PBNQ_t_Cust100019.FID AS F_LHLRZX,
PBNQ_t_Cust100019.FNUMBER AS SalesLineDailyOutstanding.PC
FROM
[D:\1礼海电气\QILKVIEW\QLIKVIEW\SalesOrderDailyOutstanding\PBNQ_t_Cust100019.qvd]
(qvd);

Inner Join
LOAD T_BD_OPERATORENTRY.LE_ID,
[T_BD_OPERATORENTRY.LCY CODE],
T_BD_OPERATORENTRY.SYSTEM,
T_BD_OPERATORENTRY.#DataDateTime,
T_BD_OPERATORENTRY.#DataDate,
T_BD_OPERATORENTRY.FENTRYID AS FSALERID,
T_BD_OPERATORENTRY.FSTAFFID AS FSTAFFID
FROM
[D:\1礼海电气\QILKVIEW\QLIKVIEW\SalesOrderDailyOutstanding\T_BD_OPERATORENTRY.qvd]
(qvd);

Inner JOIN

LOAD T_BD_STAFF_L.LE_ID,
[T_BD_STAFF_L.LCY CODE],
T_BD_STAFF_L.SYSTEM,
T_BD_STAFF_L.#DataDateTime,
T_BD_STAFF_L.#DataDate,
T_BD_STAFF_L.FSTAFFID AS FSTAFFID,
T_BD_STAFF_L.FNAME AS SalesLineDailyOutstanding.sales.representative_id
FROM
[D:\1礼海电气\QILKVIEW\QLIKVIEW\SalesOrderDailyOutstanding\T_BD_STAFF_L.qvd]
(qvd);

 

//发货通知单
DELIVERYNOTICE_TMP:
NoConcatenate
LOAD T_SAL_DELIVERYNOTICEENTRY_lk.LE_ID,
[T_SAL_DELIVERYNOTICEENTRY_lk.LCY CODE],
T_SAL_DELIVERYNOTICEENTRY_lk.SYSTEM,
T_SAL_DELIVERYNOTICEENTRY_lk.#DataDateTime,
T_SAL_DELIVERYNOTICEENTRY_lk.#DataDate,
T_SAL_DELIVERYNOTICEENTRY_lk.FSID AS FDDENTRYID,
T_SAL_DELIVERYNOTICEENTRY_lk.FENTRYID AS FFHDENTRYID
FROM
[D:\1礼海电气\QILKVIEW\QLIKVIEW\SalesOrderDailyOutstanding\T_SAL_DELIVERYNOTICEENTRY_lk.qvd]
(qvd);
inner Join
LOAD T_SAL_DELIVERYNOTICEENTRY.LE_ID,
[T_SAL_DELIVERYNOTICEENTRY.LCY CODE],
T_SAL_DELIVERYNOTICEENTRY.SYSTEM,
T_SAL_DELIVERYNOTICEENTRY.#DataDateTime,
T_SAL_DELIVERYNOTICEENTRY.#DataDate,
T_SAL_DELIVERYNOTICEENTRY.FID AS FFHDID,
T_SAL_DELIVERYNOTICEENTRY.FENTRYID AS FFHDENTRYID,
num#(T_SAL_DELIVERYNOTICEENTRY.FQTY) AS FFHDQTY,
T_SAL_DELIVERYNOTICEENTRY.FMATERIALID AS FMATERIALID,
T_SAL_DELIVERYNOTICEENTRY.FORDERNO AS SalesLineDailyOutstanding.process_id
FROM
[D:\1礼海电气\QILKVIEW\QLIKVIEW\SalesOrderDailyOutstanding\T_SAL_DELIVERYNOTICEENTRY.qvd]
(qvd);
inner join
LOAD T_SAL_DELIVERYNOTICEENTRY_F.LE_ID,
[T_SAL_DELIVERYNOTICEENTRY_F.LCY CODE],
T_SAL_DELIVERYNOTICEENTRY_F.SYSTEM,
T_SAL_DELIVERYNOTICEENTRY_F.#DataDateTime,
T_SAL_DELIVERYNOTICEENTRY_F.#DataDate,
T_SAL_DELIVERYNOTICEENTRY_F.FENTRYID as FFHDENTRYID,
num#(T_SAL_DELIVERYNOTICEENTRY_F.FALLAMOUNT, ‘####,##‘, ‘,‘, ‘.‘) as FFHDALLAMOUNT
FROM
[D:\1礼海电气\QILKVIEW\QLIKVIEW\SalesOrderDailyOutstanding\T_SAL_DELIVERYNOTICEENTRY_F.qvd]
(qvd);
inner Join
LOAD T_SAL_DELIVERYNOTICE.LE_ID,
[T_SAL_DELIVERYNOTICE.LCY CODE],
T_SAL_DELIVERYNOTICE.SYSTEM,
T_SAL_DELIVERYNOTICE.#DataDateTime,
T_SAL_DELIVERYNOTICE.#DataDate,
T_SAL_DELIVERYNOTICE.FID AS FFHDID
FROM
[D:\1礼海电气\QILKVIEW\QLIKVIEW\SalesOrderDailyOutstanding\T_SAL_DELIVERYNOTICE.qvd]
(qvd);

//出库
OUTSTOCK_TMP:
NoConcatenate
LOAD T_SAL_OUTSTOCKENTRY_LK.LE_ID,
[T_SAL_OUTSTOCKENTRY_LK.LCY CODE],
T_SAL_OUTSTOCKENTRY_LK.SYSTEM,
T_SAL_OUTSTOCKENTRY_LK.#DataDateTime,
T_SAL_OUTSTOCKENTRY_LK.#DataDate,
T_SAL_OUTSTOCKENTRY_LK.FSID AS FFHDENTRYID,
T_SAL_OUTSTOCKENTRY_LK.FENTRYID AS FCKDENTRYID
FROM
[D:\1礼海电气\QILKVIEW\QLIKVIEW\SalesOrderDailyOutstanding\T_SAL_OUTSTOCKENTRY_LK.qvd]
(qvd);
Inner Join
LOAD T_SAL_OUTSTOCKENTRY.LE_ID,
[T_SAL_OUTSTOCKENTRY.LCY CODE],
T_SAL_OUTSTOCKENTRY.SYSTEM,
T_SAL_OUTSTOCKENTRY.#DataDateTime,
T_SAL_OUTSTOCKENTRY.#DataDate,
T_SAL_OUTSTOCKENTRY.FID AS FCKDID,
T_SAL_OUTSTOCKENTRY.FENTRYID AS FCKDENTRYID,
T_SAL_OUTSTOCKENTRY.FMATERIALID AS FMATERIALID,
num#(T_SAL_OUTSTOCKENTRY.FREALQTY) AS FCKSL
FROM
[D:\1礼海电气\QILKVIEW\QLIKVIEW\SalesOrderDailyOutstanding\T_SAL_OUTSTOCKENTRY.qvd]
(qvd);

Inner Join
LOAD T_SAL_OUTSTOCKENTRY_R.LE_ID,
[T_SAL_OUTSTOCKENTRY_R.LCY CODE],
T_SAL_OUTSTOCKENTRY_R.SYSTEM,
T_SAL_OUTSTOCKENTRY_R.#DataDateTime,
T_SAL_OUTSTOCKENTRY_R.#DataDate,
T_SAL_OUTSTOCKENTRY_R.FENTRYID AS FCKDENTRYID,
T_SAL_OUTSTOCKENTRY_R.FSOORDERNO AS SalesLineDailyOutstanding.process_id
FROM
[D:\1礼海电气\QILKVIEW\QLIKVIEW\SalesOrderDailyOutstanding\T_SAL_OUTSTOCKENTRY_R.qvd]
(qvd);

Inner join
LOAD T_SAL_OUTSTOCKENTRY_F.LE_ID,
[T_SAL_OUTSTOCKENTRY_F.LCY CODE],
T_SAL_OUTSTOCKENTRY_F.SYSTEM,
T_SAL_OUTSTOCKENTRY_F.#DataDateTime,
T_SAL_OUTSTOCKENTRY_F.#DataDate,
T_SAL_OUTSTOCKENTRY_F.FENTRYID as FCKDENTRYID,
num#(T_SAL_OUTSTOCKENTRY_F.FALLAMOUNT, ‘####,##‘, ‘,‘, ‘.‘) as FCKDALLAMOUNT
FROM
[D:\1礼海电气\QILKVIEW\QLIKVIEW\SalesOrderDailyOutstanding\T_SAL_OUTSTOCKENTRY_F.qvd]
(qvd);

 

Inner Join
LOAD T_SAL_OUTSTOCK.LE_ID,
[T_SAL_OUTSTOCK.LCY CODE],
T_SAL_OUTSTOCK.SYSTEM,
T_SAL_OUTSTOCK.#DataDateTime,
T_SAL_OUTSTOCK.#DataDate,
T_SAL_OUTSTOCK.FID AS FCKDID
FROM
[D:\1礼海电气\QILKVIEW\QLIKVIEW\SalesOrderDailyOutstanding\T_SAL_OUTSTOCK.qvd]
(qvd);


//发票
INVOICE_TMP:
NoConcatenate
LOAD T_AR_RECEIVABLEENTRY_LK_CW.LE_ID,
[T_AR_RECEIVABLEENTRY_LK_CW.LCY CODE],
T_AR_RECEIVABLEENTRY_LK_CW.SYSTEM,
T_AR_RECEIVABLEENTRY_LK_CW.#DataDateTime,
T_AR_RECEIVABLEENTRY_LK_CW.#DataDate,
T_AR_RECEIVABLEENTRY_LK_CW.FSID AS FZGENTRYID,
T_AR_RECEIVABLEENTRY_LK_CW.FENTRYID AS FCWENTRYID
FROM
[D:\1礼海电气\QILKVIEW\QLIKVIEW\SalesOrderDailyOutstanding\T_AR_RECEIVABLEENTRY_LK_CW.qvd]
(qvd);

Inner Join
LOAD T_AR_RECEIVABLEENTRY_CW.LE_ID,
[T_AR_RECEIVABLEENTRY_CW.LCY CODE],
T_AR_RECEIVABLEENTRY_CW.SYSTEM,
T_AR_RECEIVABLEENTRY_CW.#DataDateTime,
T_AR_RECEIVABLEENTRY_CW.#DataDate,
T_AR_RECEIVABLEENTRY_CW.FID AS FCWID,
T_AR_RECEIVABLEENTRY_CW.FENTRYID AS FCWENTRYID,
T_AR_RECEIVABLEENTRY_CW.FMATERIALID AS FMATERIALID,
T_AR_RECEIVABLEENTRY_CW.FORDERNUMBER AS SalesLineDailyOutstanding.process_id,
num#(T_AR_RECEIVABLEENTRY_CW.FALLAMOUNT, ‘####,##‘, ‘,‘, ‘.‘) AS INVOICEFALLAMOUNT,
num#(T_AR_RECEIVABLEENTRY_CW.FPRICEQTY, ‘####,##‘, ‘,‘, ‘.‘) AS FCWSL

FROM
[D:\1礼海电气\QILKVIEW\QLIKVIEW\SalesOrderDailyOutstanding\T_AR_RECEIVABLEENTRY_CW.qvd]
(qvd);

Inner Join
LOAD T_AR_RECEIVABLE_CW.LE_ID,
[T_AR_RECEIVABLE_CW.LCY CODE],
T_AR_RECEIVABLE_CW.SYSTEM,
T_AR_RECEIVABLE_CW.#DataDateTime,
T_AR_RECEIVABLE_CW.#DataDate,
T_AR_RECEIVABLE_CW.FID AS FCWID,
T_AR_RECEIVABLE_CW.FBILLNO AS FCWFBILLNO,
T_AR_RECEIVABLE_CW.FZKJE AS SalesLineDailyOutstanding.amount_reduction
FROM
[D:\1礼海电气\QILKVIEW\QLIKVIEW\SalesOrderDailyOutstanding\T_AR_RECEIVABLE_CW.qvd]
(qvd);
Inner Join
LOAD t_AR_receivableFIN.LE_ID,
[t_AR_receivableFIN.LCY CODE],
t_AR_receivableFIN.SYSTEM,
t_AR_receivableFIN.#DataDateTime,
t_AR_receivableFIN.#DataDate,
t_AR_receivableFIN.FID AS FCWID,
t_AR_receivableFIN.FENTRYID,
t_AR_receivableFIN.FEXCHANGERATE AS FCWEXCHANGERATE
FROM
[D:\1礼海电气\QILKVIEW\QLIKVIEW\SalesOrderDailyOutstanding\t_AR_receivableFIN.qvd]
(qvd);
//


//计算amount,这里有出错,放放
//NoConcatenate
//LocalFactTable:
//load
//num#(SalesLineDailyOutstanding.Original.Amount, ‘####,##‘, ‘,‘, ‘.‘)*num#(FEXCHANGERATE, ‘####,##‘, ‘,‘, ‘.‘) AS SalesLineDailyOutstanding.amount
//Resident SALESORDER_TMP;
//Where ;

//订单
NoConcatenate
LocalFactTable:
LOAD SalesLineDailyOutstanding.process_id,
FMATERIALID,
sum(SalesLineDailyOutstanding.qty)as SUMSalesLineDailyOutstanding.qty,
sum(SalesLineDailyOutstanding.Original.Amount)as SUMSalesLineDailyOutstanding.Original.Amount,
sum(SOFALLAMOUNT) as SUMSOFALLAMOUNT
RESIDENT SALESORDER_TMP
group by SalesLineDailyOutstanding.process_id,FMATERIALID;
left join
//发货单
LOAD SalesLineDailyOutstanding.process_id,
FMATERIALID,
sum(FFHDQTY)AS SUMDELIVERYNOTICEQTY,
sum(FFHDALLAMOUNT) AS SUMDNALLAMOUNT
RESIDENT DELIVERYNOTICE_TMP
Group by SalesLineDailyOutstanding.process_id,FMATERIALID;
Left Join
//出库单
LOAD SalesLineDailyOutstanding.process_id,
FMATERIALID,
sum(FCKDALLAMOUNT) as SUMOSALLAMOUNT,
sum(FCKSL)AS SUMOUTSTOCKQTY
RESIDENT OUTSTOCK_TMP
Group by SalesLineDailyOutstanding.process_id,FMATERIALID;
Left Join
//发票
LOAD SalesLineDailyOutstanding.process_id,
FMATERIALID,
sum(FCWSL)AS SUMINVOICEQTY,
sum(INVOICEFALLAMOUNT) AS SUMINVOICEALLAMOUNT
RESIDENT INVOICE_TMP
Group by SalesLineDailyOutstanding.process_id,FMATERIALID;

 

QLIKVIEW-SALESORDER\DELIVERYNOTICE\OUTSTOCK\INVOICE

标签:promise   creat   create   销售订单   tocken   ber   ide   group   seq   

原文地址:https://www.cnblogs.com/RogerLu/p/11691451.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!