Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Error in expression ')' expected

Hai,

Load

Id,

qty,

Date

from (etc)

Max(Date) as maxdate

set vmax=floor(peek(maxdate));

if(programdate=Date or programdate=vmax,qty,0) as Qty

if i reload this script means it showing  Error in expression ')' expected.why this error is coming..thanks in advance

10 Replies
sunny_talwar

Is this if statement withing a table load, right? not just sitting there all by itself?


LOAD BlahBlah,

     if(programdate=Date or programdate=vmax,qty,0) as Qty

FROM ....

Anonymous
Not applicable
Author

Sorry I forgot to tell.i just create resident table..in dt nly i have created  if condition

annafuksa1
Creator III
Creator III

Could you copy full script ? or the app ?

Here looks like wrong order.

Anonymous
Not applicable
Author

A:

LOAD

     Max(programdate) as MaxDate

Resident 1;

LET vMaxDate = floor(peek('MaxDate'));

DROP Table A;

2:

LOAD *,

     if(((programdate=Date(Floor(MonthEnd(programdate))))or programdate=$(vMaxDate)),Quantity,0) as month_qty,

  

     Resident 1;

     DROP Table 1;

this is my script..bt it showing error

annafuksa1
Creator III
Creator III

the problem is unnecessary ','

2:

LOAD *,

    if(((programdate=Date(Floor(MonthEnd(programdate))))or programdate=$(vMaxDate)),Quantity,0) as month_qty,

    Resident 1;

    DROP Table 1;

try

2:

LOAD *,

    if(((programdate=Date(Floor(MonthEnd(programdate))))or programdate=$(vMaxDate)),Quantity,0) as month_qty

    Resident 1;

    DROP Table 1;

Anonymous
Not applicable
Author

sorry dt mistake made by me.in originally i am not putting ','.can u pls explain wht is d error in thz

sunny_talwar

How about this (tried to get rid of unnecessary parenthesis):

A:

LOAD Max(programdate) as MaxDate

Resident 1;

LET vMaxDate = floor(peek('MaxDate'));

DROP Table A;

2:

LOAD *,

     If(programdate = Floor(MonthEnd(programdate)) or programdate = $(vMaxDate), Quantity, 0) as month_qty 

Resident 1;

DROP Table 1;

Anonymous
Not applicable
Author

Hai sunny..

i have tried ths,whtever i do it shows ths error nly.and also i can't view this table in table viewr.is ths a common error'a.???

annafuksa1
Creator III
Creator III

sorry didn't understand your answer.

the mistake I point was that you put ',' in load script between dimension, in your script Qlikview thought that Resident is another field and there is no 'from/Resident' and that couse error.

second I think your calculation may be incorrect,

are you trying to calculate max quantity per month ?