我加载以下输入表
通过这个脚本:
source_table:
Load company,
product,
sales
FROM source_file1.xlsx
列highest_selling是销售此特定产品的公司的指标。如何才能做到这一点? 任何帮助将不胜感激。
此致 丹尼尔
答案 0 :(得分:0)
加载源码后。
source_table:
Load company,
product,
sales
FROM source_file1.xlsx
然后找到最高卖家。
Highest:
Load product,
max(sales) as Highest
resident source_table group by product;
然后将最高指标加回到源表
left join (source_table)
load product,
Highest as sales,
1 as highest_seller
resident Highest; drop table Highest;