Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 
					
				
		
Hi All,
I have same product codes in my data base with different prices. so what I do is, product codes renamed in my script as follows.
IF(PRD_CODE='LI' AND 600<GRO_PRE>650, PRO_CODE="LI1"),
IF(PRD_CODE='LI' AND 1150<GRO_PRE>1250, PRO_CODE="LI2"),
IF(PRD_CODE='LI' AND 1550<GRO_PRE>1650, PRO_CODE="LI3"),
In the script above conditions are not shows an error but script can not loaded. The machine is getting stuck.
Please help to solve the problem.
Regards,
Priyantha
 
					
				
		
 jduenyas
		
			jduenyas
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Try
IF(PRD_CODE='LI' And GRO_PRE > 600 And GRO_PRE < 650, PRO_CODE='LI1') Etc.
Watch out for the double quotes as you have it at the end of the statement. Should be single quote.
Josh
 
					
				
		
Hi Piyantha, you may have different prices for the same product code because of you are using different price list, Try to bundle price list and product code together generate a unique product code. or if you want just distinct product codes, just load sql with DISTINCT or use MODE() function.
 
					
				
		
 jyothish8807
		
			jyothish8807
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi Priyantha,
Try like this:
IF(PRD_CODE='LI' AND GRO_PRE > 600 And GRO_PRE < 650, Replace(PRO_CODE,'LI','LI1')
Regards
KC
 
					
				
		
you can use following SCRIPT to bundle the pricelist and productcode product & '|' & pricelist as Productkey,
 
					
				
		
 Sokkorn
		
			Sokkorn
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi Priyantha,
Can you check logic which I have highlight below. It seem not make sense.
PRIYANTHA BANDARA wrote:
IF(PRD_CODE='LI' AND 600<GRO_PRE>650, PRO_CODE="LI1"),
IF(PRD_CODE='LI' AND 1150<GRO_PRE>1250, PRO_CODE="LI2"),
IF(PRD_CODE='LI' AND 1550<GRO_PRE>1650, PRO_CODE="LI3"),
Anyhow, here is my idea:
If(PRD_CODE='LI',
If(GRO_PRE>650,'L|1',
If(GRO_PRE>1250,'L|2',
If(GRO_PRE>1650,'L|3','Others')))
,PRD_CODE
)
Regards,
Sokkorn
