from great_outdoors_sales..gosales.time_dimension T1
select
T1.current_year as current_year,
T1.month_key as month_key,
XMIN(T1.days_in_month for T1.current_year,T1.month_key) as days_in_month
from great_outdoors_sales..gosales.time_dimension T1
group by T1.current_year,T1.month_key
将上图表1的效果转化为普通的SQL就好理解得多了:
Select current_year,month_key,min(days_in_month) from Time_dimension Group by current_year,month_key
以上是一个比较简单的理解实例,那么在实际应用中,如事实表、维表,也经常使用了决定个因素。一般来说,只要你的数据表中设置了PK(主键),当被导入FM之后系统自动根据PK设置了决定因素,确保聚合运算避免double count,如下图: