Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Group by: Invalid Expression

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

1 Solution

Accepted Solutions
whiteline
Master II
Master II

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.

View solution in original post

2 Replies
whiteline
Master II
Master II

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.

Not applicable
Author

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!