0

尝试从 SQL Server 存储过程加载数据,这适用于其他过程,但不想在这种情况下工作。

Load *;
Sql Exec [Report].[UspResults_SalesOrderKPI] @Company = '10' , 
@RedTagType = 'Q' , 
@RedTagUse = '' ;

我确定我错过了一些简单的东西,但我看不到它。

我将使用的最终代码如下所示。

RawSysOrders:
Load StockDescription As Product
,CustomerPoNumber As PO
,SalesOrder As PBL_Ref
,AcceptedDate
,ActualDeliveryDate As ActualShipDate
,Null() As Confirmation
,PlannedDeliverDate As ProposedShipDate
,Null() As RevisedShipDate1
,Null() As RevisedShipDate2
,Null() As RevisedShipDate3
,OrderQty As Qty
,StockCode As Code
,Null() As Volume
,Job As Batch
,CustomerName As DeliveredTo
,CustomerName As SoldTo
,Null() As PaymentTerms
,ApplyMap('Map_SOPrices',SalesOrder&'_'&SalesOrderLine,0) As GBP
,0 As USD
,0 As Euro
,1 As USDRate
,1 As EuroRate
,0 As ShippingCost
,If(ActualDeliveryDate<=PlannedDeliverDate,'Yes','No') As ShipDateMet
,DaysDiff As DaysOVer
,DispatchComments As NotesProblems
,Year(EntrySystemDate) as File;
where Year(EntrySystemDate)>=2016;
Sql Exec [BlackBox].[Report].[UspResults_SalesOrderKPI] @Company = '10' ,
@RedTagType = 'Q' ,
@RedTagUse = 'Qlik Sense > Product KPIs';
4

1 回答 1

1

查看 SQL 代码,我现在相信我已经解决了这个问题。

Qlik 不能很好地处理 SQL 行数,在我的 sql 查询开始时,我有一个插入导致 1 行的行数受到影响。

为了解决这个问题,我设置

nocount on

在查询开始时,另外我必须设置

nocount off

在返回数据之前。

于 2016-05-16T15:03:46.463 回答