【发布时间】:2014-08-14 05:53:06
【问题描述】:
目前我正在尝试编写一个表达式,但我只知道如何在 SQl 语句中查询它
SQL:
select * from Orders o
where o.product_name != MBProductName
AND
o.transaction_id in
(
select m.transaction_id from marketBasket m where m.product_name = MBProductName);
我想把结果做成表格形式的图表。
当我选择 MBProductName 时,它会执行此查询。
谁能帮我翻译一下?提前致谢
我的脚本:
LOAD
Customer_ID,
Customer_Country,
Customer_Gender,
Customer_BirthDate,
Customer_Age_Group,
Customer_Type,
Customer_Age,
Real_age,
Continent,
Country_Name
Orders:
LOAD
Customer_ID,
Employee_ID,
Street_ID,
Order_Date,
Delivery_Date,
Order_ID As %%MarketBasket,
Order_ID,
Order_Type,
Product_ID,
Quantity,
Total_Retail_Price,
CostPrice_Per_Unit,
Discount,
Profit_per_Product,
PrfitRange,
ProfitMarginRange
Products:
LOAD Product_ID,
Product_Line,
Product_Category,
Product_Group,
Product_Name,
Supplier_Country,
Supplier_Name
TmpMarketBasket:
Load
%%MarketBasket AS TmpOrderId,
Product_ID AS TmpProductId,
Order_Date As TmpOrderDate
Resident Orders;
LEFT JOIN
Load
Product_ID AS TmpProdcutId,
Product_Name AS TmpProductName,
Product_Line AS TmpProductLine,
Product_Category As TmpProductCategory,
Product_Group As TmpProductGroup
Resident Products;
MarketBasket:
LOAD
TmpOrderId as %%MarketBasket,
TmpProductName as MBProductName,
TmpProductGroup as MBProductGroup
RESIDENT TmpMarketBasket;
DROP TABLE TmpMarketBasket;
【问题讨论】:
标签: sql expression qlikview