//销售订单
SALESORDER_BASE_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 SALES_INCOMING.process_id,
T_SAL_ORDER.FCUSTID AS FCUSTID,
date(num#(T_SAL_ORDER.FCREATEDATE, '#.##0,0', ',', '.')) AS SALES_INCOMING.date, //美国格式
date(num#(T_SAL_ORDER.FAPPROVEDATE,'#.##0,0', ',', '.')) AS SALES_INCOMING.DateFirstOrderConfirmation,
T_SAL_ORDER.FSALERID AS FSALERID
FROM
[D:\QILKVIEW\QLIKVIEW\SalesOrderIncome\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.FMATERIALID AS FMATERIALID,
T_SAL_ORDERENTRY.FID AS FID,
T_SAL_ORDERENTRY.FENTRYID AS FENTRYID,
T_SAL_ORDERENTRY.FSEQ AS SALES_INCOMING.process_pos_nr,
T_SAL_ORDERENTRY.FQTY AS SALES_INCOMING.qty,
num#(T_SAL_ORDERENTRY.FZQTAXAMOUNT, '####,##', ',', '.') AS FZQTAXAMOUNT

FROM
[D:\QILKVIEW\QLIKVIEW\SalesOrderIncome\T_SAL_ORDERENTRY.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.FID AS FID,
T_SAL_ORDERENTRY_F.FENTRYID AS FENTRYID,
T_SAL_ORDERENTRY_F.FAMOUNT AS SALES_INCOMING.Original.Amount_1,
T_SAL_ORDERENTRY_F.FAMOUNT_LC AS SALES_INCOMING.amount_1,
T_SAL_ORDERENTRY_F.FALLAMOUNT,
T_SAL_ORDERENTRY_F.FALLAMOUNT_LC
FROM
[D:\QILKVIEW\QLIKVIEW\SalesOrderIncome\T_SAL_ORDERENTRY_F.qvd]
(qvd);

//销售订单
SALESORDER_TMP:
load
SALES_INCOMING.process_id,
FMATERIALID,
FCUSTID,
FSALERID,
FID,
sum( num#(SALES_INCOMING.Original.Amount_1, '####,##', ',', '.')) AS SALES_INCOMING.Original.Amount,
SUM(num#(SALES_INCOMING.amount_1, '####,##', ',', '.')) AS SALES_INCOMING.amount
RESIDENT SALESORDER_BASE_TMP
Group By
SALES_INCOMING.process_id,
FMATERIALID,
FCUSTID,
FSALERID,
FID;

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 SALES_INCOMING.customer.id
FROM
[D:\QILKVIEW\QLIKVIEW\SalesOrderIncome\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:\QILKVIEW\QLIKVIEW\SalesOrderIncome\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 SALES_INCOMING.PC
FROM
[D:\QILKVIEW\QLIKVIEW\SalesOrderIncome\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 SALES_INCOMING.sales.representative.Code
FROM
[D:\QILKVIEW\QLIKVIEW\SalesOrderIncome\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 SALES_INCOMING.sales.representative.Code,
T_BD_STAFF_L.FNAME AS SALES_INCOMING.sales.representative_id
FROM
[D:\QILKVIEW\QLIKVIEW\SalesOrderIncome\T_BD_STAFF_L.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 SALES_INCOMING.article.id
FROM
[D:\QILKVIEW\QLIKVIEW\SalesOrderIncome\T_BD_MATERIAL.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 FCURRENCYID,
T_SAL_ORDERFIN.FExchangeRate AS FExchangeRate,
T_SAL_ORDERFIN.FBILLALLAMOUNT ,
T_SAL_ORDERFIN.FBILLALLAMOUNT_LC
FROM
[D:\QILKVIEW\QLIKVIEW\SalesOrderIncome\T_SAL_ORDERFIN.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 FCURRENCYID,
T_BD_CURRENCY.FNUMBER AS SALES_INCOMING.currency,
T_BD_CURRENCY.FCODE AS SALES_INCOMING.Original.Currency.Code
FROM
[D:\QILKVIEW\QLIKVIEW\SalesOrderIncome\T_BD_CURRENCY.qvd]
(qvd);

//销售出库单
OUTSTOCK_TMP:
NoConcatenate
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 FOUTSTOCKID,
T_SAL_OUTSTOCK.FBILLNO,
T_SAL_OUTSTOCK.FDOCUMENTSTATUS
FROM
[D:\QILKVIEW\QLIKVIEW\SalesOrderIncome\T_SAL_OUTSTOCK.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 FOUTSTOCKID,
T_SAL_OUTSTOCKENTRY.FENTRYID AS FSTOCKENTRYID,
T_SAL_OUTSTOCKENTRY.FMATERIALID AS FMATERIALID
FROM
[D:\QILKVIEW\QLIKVIEW\SalesOrderIncome\T_SAL_OUTSTOCKENTRY.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 FSTOCKENTRYID,
T_SAL_OUTSTOCKENTRY_F.FCOSTPRICE AS FCOSTPRICE,
T_SAL_OUTSTOCKENTRY_F.FCOSTAMOUNT AS FCOSTAMOUNT
FROM
[D:\QILKVIEW\QLIKVIEW\SalesOrderIncome\T_SAL_OUTSTOCKENTRY_F.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 FSTOCKENTRYID,
T_SAL_OUTSTOCKENTRY_R.FSOORDERNO AS SALES_INCOMING.process_id
FROM
[D:\QILKVIEW\QLIKVIEW\SalesOrderIncome\T_SAL_OUTSTOCKENTRY_R.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:\QILKVIEW\QLIKVIEW\SalesOrderIncome\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 SALES_INCOMING.process_id,
// num#(T_AR_RECEIVABLEENTRY_CW.FALLAMOUNTFOR, '####,##', ',', '.') AS INVOICEFALLAMOUNT,
// //折扣金额
// num#(T_AR_RECEIVABLEENTRY_CW.FSPLITAMOUNT, '####,##', ',', '.') AS INVOICEFSPLITAMOUNT,
// num#(T_AR_RECEIVABLEENTRY_CW.FPRICEQTY, '####,##', ',', '.') AS FCWSL
//
//FROM
//[D:\QILKVIEW\QLIKVIEW\SalesOrderIncome\T_AR_RECEIVABLEENTRY_CW.qvd]
//(qvd);

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.FPRICEQTY,
T_AR_RECEIVABLEENTRY_CW.FALLAMOUNTFOR,
T_AR_RECEIVABLEENTRY_CW.FORDERNUMBER AS SALES_INCOMING.process_id,
T_AR_RECEIVABLEENTRY_CW.FMATERIALID AS FMATERIALID,
T_AR_RECEIVABLEENTRY_CW.FALLAMOUNT,
T_AR_RECEIVABLEENTRY_CW.FNOTAXAMOUNTFOR AS FNOTAXAMOUNTFOR,
T_AR_RECEIVABLEENTRY_CW.FSPLITAMOUNT AS INVOICEFSPLITAMOUNT
FROM
[D:\QILKVIEW\QLIKVIEW\SalesOrderIncome\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 FZKJE
FROM
[D:\QILKVIEW\QLIKVIEW\SalesOrderIncome\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,
num#(t_AR_receivableFIN.FEXCHANGERATE, '####,##', ',', '.') AS FCWEXCHANGERATE
FROM
[D:\QILKVIEW\QLIKVIEW\SalesOrderIncome\t_AR_receivableFIN.qvd]
(qvd);

//发票进行单号,物料分组
INVOICE_GET_TMP:
NoConcatenate
load
SALES_INCOMING.process_id,
FMATERIALID,
sum( num#(FNOTAXAMOUNTFOR, '####,##', ',', '.')) AS INVOICENOTTAXEDAMOUNT_1,
sum( num#(INVOICEFSPLITAMOUNT, '####,##', ',', '.')) AS INVOICEFSPLITAMOUNT_1
RESIDENT INVOICE_TMP
Group By SALES_INCOMING.process_id,
FMATERIALID;

//计算出库单成本
OUTSTOCK_CALCULATION_TMP:
NoConcatenate
load
SALES_INCOMING.process_id,
FMATERIALID,
sum(num#(FCOSTAMOUNT, '####,##', ',', '.')) AS SUMCOSTAMOUNT
RESIDENT OUTSTOCK_TMP
Group By SALES_INCOMING.process_id,
FMATERIALID
;

//汇总输出发票金额 产品成本
PROFIT_GET_TMP:
NoConcatenate
load SALES_INCOMING.process_id,
FMATERIALID,
max(INVOICENOTTAXEDAMOUNT_1) AS SUMINVOICENOTTAXEDAMOUNT,
max(INVOICEFSPLITAMOUNT_1) AS SALES_INCOMING.Original_amount_reduction
RESIDENT INVOICE_GET_TMP
Group By SALES_INCOMING.process_id,
FMATERIALID;

Left Join

load SALES_INCOMING.process_id,
FMATERIALID,
MAX(SUMCOSTAMOUNT) AS SUMPRODUCTCOST
RESIDENT OUTSTOCK_CALCULATION_TMP
Group By SALES_INCOMING.process_id,
FMATERIALID;

//计算利润
PROFIT_CALCULATION_TMP:
NoConcatenate
load SALES_INCOMING.process_id,
FMATERIALID,
max(SUMINVOICENOTTAXEDAMOUNT - SUMPRODUCTCOST) AS SALES_INCOMING.profit
RESIDENT PROFIT_GET_TMP
Group by SALES_INCOMING.process_id,FMATERIALID;

SALESORDERINCOME.QVW的更多相关文章

  1. QVW中实现日期区间的选择功能!

    QV在日期的选择上不是很灵活,日期区段的选择可以在列表框中直接用鼠标拖拉区段,如果跨周期比较长了还是不是很方便啦. 下面介绍的方式是完全实现了起始日期的选择功能. 注:日期这个字段在抽取的时候一定要格 ...

  2. Android入门(一)

    原文链接:http://www.orlion.ga/387/ 一.安卓的系统架构 1. linux内核层,这一层为安卓设备提供底层的驱动 系统运行库层,这一层通过一些C/C++库来为Android系统 ...

  3. Python之路【第二十篇】Tornado框架

    Tornado Tornado是使用Python编写的一个强大的.可扩展的Web服务器.它在处理严峻的网络流量时表现得足够强健,但却在创建和编写时有着足够的轻量级,并能够被用在大量的应用和工具中. 我 ...

  4. step by step install Caffe

    Caffe + Ubuntu 14.04 + CUDA 8 + cudnn 8.0+Ananconda3+opencv3.0.0 //由于本人使用的是英文版ubuntu,没装汉语输入法,暂时就用蹩脚的 ...

  5. QlikView 权限设置问题和注意

    企业级报表通常都涉及到复杂的权限问题, 比如文本级权限和行级权限,某区域经理只能看到该区域的销售数据.QlikView自然也提供了该种功能. 具体方法: 在Edit script中新建一个tab, 输 ...

  6. Ubuntu环境搭建系列—WPS/LAMP/Python篇

    由于篇幅不宜太长,所以就将此文分成了两部分,在第一部分中我们讲解了google-chrome(谷歌浏览器)的安装,jdk的环境配置,android开发的环境搭建.那么在第二部分中,位们将讲解的是金山W ...

  7. 说说设计模式~观察者模式(Observer)

    返回目录 观察者模式,也叫发布/订阅模式(publish/subscribe),监视器模式等.在此种模式中,一个目标物件管理所有相依于它的观察者物件,并且在它本身的状态改变时主动发出通知.这通常透过呼 ...

  8. rfc2616 HTTP Protocl Analysis

    catalog . Introduction . Protocol Parameters . HTTP Message . Request . Response . HTTP Method.Conte ...

  9. WAF(Web Appliction Firewall) Bypass Technology Research

    catalog . What is Firewall . Detecting the WAF . Different Types of Encoding Bypass . Bypass本质 1. Wh ...

随机推荐

  1. taro编译的时候报 exports.pRimraf = util_1.promisify(rimraf); 错误

    C:\Users\1\AppData\Roaming\npm\node_modules\@tarojs\cli\dist\h5\helper.js:8 exports.pRimraf = util_1 ...

  2. POJ1833 & POJ3187 & POJ3785

    要是没有next_permutation这个函数,这些题觉得还不算特别水,不过也不一定,那样可能就会有相应的模板了.反正正是因为next_permutation这个函数,这些题包括之前的POJ1226 ...

  3. cf 609E.Minimum spanning tree for each edge

    最小生成树,lca(树链剖分(太难搞,不会写)) 问存在这条边的最小生成树,2种情况.1.这条边在原始最小生成树上.2.加上这条半形成一个环(加上),那么就找原来这条边2端点间的最大边就好(减去).( ...

  4. React16 新特性

    一.使用Error Boundary处理错误组件         React16之前:组件在运行期出错,会阻塞整个应用的渲染.   React16之后:引入新的错误处理机制——Error Bounda ...

  5. tensorflow--conv函数

    #第一种yolo3中程序 def convolutional(input_data, filters_shape, trainable, name, downsample=False, activat ...

  6. python 符号小技巧

    1 用于解释 对于不想放入程序中执行的句子  用来解释的 在Python中 单行注释用   #   多行注释用 """ 这个句子不会在Python中表达出来 " ...

  7. 多源D点(邻接表+bfs)

    [问题]给出一颗n个结点的树,树上每条边的边权都是1,这n个结点中有m个特殊点,请你求出树上距离这m个特殊点距离均不超过d的点的数量,包含特殊点本身. 输入: 输入第一行包含三个正整数,n.m.d分别 ...

  8. linux_ssh用户枚举猜测

    新建一个用户名txt文档,写入常用的用户名 msfconsole use auxiliary/scanner/ssh/ssh_enumusers3

  9. Codeforces Round #599 (Div. 2) Tile Painting

    题意:就是给你一个n,然后如果  n mod | i - j | == 0  并且 | i - j |>1 的话,那么i 和 j 就是同一种颜色,问你最大有多少种颜色? 思路: 比赛的时候,看到 ...

  10. ubuntu虚拟机的日常使用

    一.下载地址 1.ubuntu 16.04 镜像下载 二.上网 1.IP地址设置 1)参考网址1:ubuntu修改IP地址和网关的方法 2)参考网址2:ubuntu如何修改IP地址.和apt源 2)参 ...