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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Need help in Aggregation functions

I need count the days of a customer buy our product and then sum the quantity of product in the month the customer buy to obtain the Average by day by product that this customer is buying.

And then create a Range like:

0 to 5

5 to 10

10 to 15

-.......

over 60.

and calculate how many customer by products average I have in the one of the ranges.

But in the aggregations functions on the load I have the problem that forward:

Invalid expression

Movimientos2009:

LOAD RECNO() AS INDEX,

cod_producto,

cod_cliente,

cod_sucursal,

año,

mes,

dia,

cod_fecha,

cantidad,

kilos,

dolares,

indiventa,

count(distinct dia) as diacompra,

sum(cantidad)/COUNT(DISTINCT dia) as avgsale,

vendedor

FROM

QVD\movimientos2009.qvd

(qvd)

group by cod_producto,

mes;



1 Solution

Accepted Solutions
johnw
Champion III
Champion III

Every field must be either in the group by, or calculated using an aggregation.

View solution in original post

1 Reply
johnw
Champion III
Champion III

Every field must be either in the group by, or calculated using an aggregation.