Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
QS_
Contributor III
Contributor III

Invalid Expression error when using group by

I am trying to load the following script

YearlyCalculation:
Load flt_no,
dep_stn,
arr_stn,
Month(flt_date) as [Day/Month],
Year(flt_date) as [Period],
sum((taxi_out_fuel_weight_kg+trip_fuel_kg) - (fob_engine_start_kg-fob_intime_kg))/30 as Delta,
interval(ata-atd-(sta-std),'m') as TimeDiff,
((zfw*2.971548)-planned_zero_fuel_weight_kg)/30 as ZFWstuff
Resident LidoData
Group By
flt_no,
dep_stn,
arr_stn;
drop Table LidoData
;

I get an 'Invalid expression' error when I try to load the data. What could be the possible reason? How do I fix it?

Labels (2)
1 Solution

Accepted Solutions
nomananjum95
Partner - Contributor II
Partner - Contributor II

Dear,

Add the rest of the fields that are not used in aggregation like flt_date , zfw , ata, atd, sta, std and planned_zero_fuel_weight_kg.

As i'm assuming ata, atd, sta, and std are multiple fields.

 

YearlyCalculation:
Load flt_no,
dep_stn,
arr_stn,
Month(flt_date) as [Day/Month],
Year(flt_date) as [Period],
sum((taxi_out_fuel_weight_kg+trip_fuel_kg) - (fob_engine_start_kg-fob_intime_kg))/30 as Delta,
interval(ata-atd-(sta-std),'m') as TimeDiff,
((zfw*2.971548)-planned_zero_fuel_weight_kg)/30 as ZFWstuff
Resident LidoData
Group By
flt_no,
dep_stn,
arr_stn,
flt_date,
ata,
atd,
sta,
std,
zfw,
planned_zero_fuel_weight_kg ;


drop Table LidoData;

View solution in original post

1 Reply
nomananjum95
Partner - Contributor II
Partner - Contributor II

Dear,

Add the rest of the fields that are not used in aggregation like flt_date , zfw , ata, atd, sta, std and planned_zero_fuel_weight_kg.

As i'm assuming ata, atd, sta, and std are multiple fields.

 

YearlyCalculation:
Load flt_no,
dep_stn,
arr_stn,
Month(flt_date) as [Day/Month],
Year(flt_date) as [Period],
sum((taxi_out_fuel_weight_kg+trip_fuel_kg) - (fob_engine_start_kg-fob_intime_kg))/30 as Delta,
interval(ata-atd-(sta-std),'m') as TimeDiff,
((zfw*2.971548)-planned_zero_fuel_weight_kg)/30 as ZFWstuff
Resident LidoData
Group By
flt_no,
dep_stn,
arr_stn,
flt_date,
ata,
atd,
sta,
std,
zfw,
planned_zero_fuel_weight_kg ;


drop Table LidoData;