Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Query Error

We often model our queries using MS SQL Server Management Studio or, in this case, Oracle Interactive Reporting. The following query works fine in both of these tools but QlikView throws up an error (with no useful information). Can anyone tell me why QlikView is balking at this syntax?

Orders:

SQL

SELECT DISTINCT

AL8.Bill_to_Customer_Number,

AL8.Ship_to_Customer_Number,

AL11.Customer_Name,

AL8.Order_Type,

AL8.Invoice_Date,

AL8.Sales_Order_Number,

AL8.Customer_PO,

SUM ( AL8.Sales_Pounds ),

SUM ( AL8.Sales_Cases ),

SUM ( AL8.Product_Price_Extended ),

AL13.OA_Number

FROM

dbo.Customer_Master AL11,

dbo.Monthly_Calendar AL12,

dbo.Sales_Detail AL8 LEFT OUTER JOIN dbo.IOS_Sales_Order AL13 ON (AL8.Sales_Order_Number=AL13.Sales_Order_Number AND AL8.Customer_PO=AL13.Customer_PO AND AL8.Order_Type=AL13.Order_Type)

WHERE (AL8.Ship_to_Customer_Number=AL11.Customer_Number

AND AL8.Fiscal_Period_Date=AL12.Fiscal_Period_Date) 

AND ((AL12.Fiscal_Period_Relative>=-6

AND AL8.Bill_to_Customer_Number IN (760, 773, 774, 797)))

GROUP BY AL8.Bill_to_Customer_Number, AL8.Ship_to_Customer_Number, AL11.Customer_Name, AL8.Order_Type, AL8.Invoice_Date, AL8.Sales_Order_Number, AL8.Customer_PO, AL13.OA_Number

;

1 Solution

Accepted Solutions
Not applicable
Author

Did you try aliasing the column names for with group functions?

SUM ( AL8.Sales_Pounds ) as Sales_Pounds,

SUM ( AL8.Sales_Cases ) as Sales_Cases,

SUM ( AL8.Product_Price_Extended ) as Product_Price_Extended,

Kiran.

View solution in original post

2 Replies
Not applicable
Author

Did you try aliasing the column names for with group functions?

SUM ( AL8.Sales_Pounds ) as Sales_Pounds,

SUM ( AL8.Sales_Cases ) as Sales_Cases,

SUM ( AL8.Product_Price_Extended ) as Product_Price_Extended,

Kiran.

Anonymous
Not applicable
Author

That did it, thanks!