Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello!
Could someone help me, please, to find out, what is wrong in script?
type_fact:
load
State ,
Company,
Channel,
Material_Name,
Type ,
TradeMark,
Direction ,
DocNumber,
//Weight,
Date,
Year(Date) as Year,
Month(Date) as Month,
Client_code,
sum(Weight) as type_sum_weight,
'All'&Type as Group
resident FACT Group by Direction,TradeMark,Type,Company, State,Channel;
FACT- is a table, result of some joins, type_fact is a table of aggregatetd values of salesAmount (in weight)/ I wanted load not all fields in the type_fact, onle those needed for aggregation.
Thnx in advance
Hi.
You have to mention all of the fields that are supposed not to be aggregated (all except Weight in the above case).
group by is a clause used for defining over which fields the data should be aggregated (grouped). The aggregation fields should be included in some way in the expressions loaded. No other fields than the aggregation fields may be used outside aggregation functions in the loaded expressions.
Hi.
You have to mention all of the fields that are supposed not to be aggregated (all except Weight in the above case).
group by is a clause used for defining over which fields the data should be aggregated (grouped). The aggregation fields should be included in some way in the expressions loaded. No other fields than the aggregation fields may be used outside aggregation functions in the loaded expressions.
Thanks for your answer,whiteline!!
type_fact:
load
State ,
Company,
Channel,
Type ,
TradeMark,
Direction ,
Year,
Month,
sum(Weight) as type_sum_weight
resident FACT Group by Year,Month,Direction,TradeMark,Type,Company, State,Channel;
Works correctly!