Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

day sum from hour data

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

;

1 Solution

Accepted Solutions

Re: day sum from hour data

Hi Andreas, you need to add 'unit' to the group by clause, or remove it from the LOAD.

5 Replies
Not applicable

Re: day sum from hour data

GROUP by source;

Should be:

GROUP by day, source, unit;

Re: day sum from hour data

Hi Andreas, you need to add 'unit' to the group by clause, or remove it from the LOAD.

Re: day sum from hour data

add unit also in group by

Employee
Employee

Re: day sum from hour data

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

leomathew
New Contributor III

Re: day sum from hour data


Dummy_byhours:

LOAD source,
mon,
day,
hour,
parameter,
unit,
DATA as DATA_h
FROM

(
ooxml, embedded labels, table is test);



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;

Community Browser