Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 
					
				
		
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
 sunny_talwar
		
			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 ....
 
					
				
		
Sorry I forgot to tell.i just create resident table..in dt nly i have created if condition
 
					
				
		
 annafuksa1
		
			annafuksa1
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Could you copy full script ? or the app ?
Here looks like wrong order.
 
					
				
		
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
		
			annafuksa1
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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;
 
					
				
		
sorry dt mistake made by me.in originally i am not putting ','.can u pls explain wht is d error in thz
 sunny_talwar
		
			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;
 
					
				
		
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
		
			annafuksa1
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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 ?
