Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
im loading large amounts of data from a database, and the data is too much detailed for the current task.
the data was created every hour, but only the sums of each day and month are needed.
The same group by has worked before on other projects and the editor shows no error, but when reloading the script, i just get a script error for the day_sums table.
Any ideas what could be the problem here ? The qv compiler is not helpfull (as always)
the testdata.xlsx is attached
Dummy_byhours:
LOAD source,
mon,
day,
hour,
parameter,
unit,
// sum(Daten),
DATA as DATA_h
FROM
.\test_data.xlsx
(ooxml, embedded labels, table is Tabelle1);
day_sums:
noconcatenate LOAD
source,
day,
sum(DATA_h) as DATA_d_sum, // script error here
unit
RESIDENT Dummy_byhours
GROUP by day, source
;
Hi Andreas, you need to add 'unit' to the group by clause, or remove it from the LOAD.
GROUP by source;
Should be:
GROUP by day, source, unit;
Hi Andreas, you need to add 'unit' to the group by clause, or remove it from the LOAD.
add unit also in group by
Data:
LOAD source,
mon,
day,
parameter,
unit,
sum(DATA) as Data
FROM [.\test_data.xlsx] (ooxml, embedded labels, table is Tabelle1)
GROUP BY source, mon, day, parameter, unit;
HIC
Dummy_byhours:
LOAD source,
mon,
day,
hour,
parameter,
unit,
DATA as DATA_h
FROM
(
day_sums:
noconcatenate
LOAD
source,
day,
sum(DATA_h) as DATA_d_sum, // script error here
unit
RESIDENT Dummy_byhours
GROUP by day, source ,unit
;
//drop if not required
drop table Dummy_byhours;