Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
agrimroquette
Contributor II

Invalid expression

Hi,

can anyone help me, why this expression in script giving Invalid expression


if(((Avg([Rating #])))='1', 'a', if(((Avg([Rating #])))=2, 'b')) as classification


Thanks

3 Replies
MVP
MVP

Re: Invalid expression

Missing  Group By clause may be?

Re: Invalid expression

Avg should need Group By. Without that it won't work for aggregate functions like Sum, Avg, Count ... in script

Life is so rich, and we need to respect to the life !!!
jhoef-pv
New Contributor III

Re: Invalid expression

Hi Agrim,
Avg need group by

for example:

table:

load

field_1,

if(((Avg([Rating #])))='1', 'a', if(((Avg([Rating #])))=2, 'b')) as classification

from table.xls

group by  field_1;

Community Browser