Print Page | Close Window

convert parameter into a single formula

Printed From: Crystal Reports Book
Category: General Information
Forum Name: Announcements
Forum Discription: Please check this section for the latest announcements from Crystal Reports Forum
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=6420
Printed Date: 01 May 2024 at 5:32pm


Topic: convert parameter into a single formula
Posted By: joenellagz
Subject: convert parameter into a single formula
Date Posted: 21 May 2009 at 1:53am
 
hi i am working with item valuation report and there is a cost conversion on the old report that we are using i want to convert the parameter into a single formula i want to simplify the report and there is an cost conversion can u help to solve this problem ({?VALU1}) is a parameter i want to simplify this syntax into a single many thanks
 
 
 
 
NumberVar valu := ToNumber({?VALU1});

IF valu = 1   then {ICIVAL.TRANSCOST}
else if valu = 2 then if {ICIVAL.COSTCONV} <> 0 then {ICIVAL.RECENTCOST}*{ICIVAL.QUANTITY}*{ICIVAL.CONVERSION}/{ICIVAL.COSTCONV} else {ICIVAL.RECENTCOST}*{ICIVAL.QUANTITY}*{ICIVAL.CONVERSION}
else if valu = 3 then if {ICIVAL.COSTCONV} <> 0 then {ICIVAL.STDCOST}*{ICIVAL.QUANTITY}*{ICIVAL.CONVERSION}/{ICIVAL.COSTCONV} else {ICIVAL.STDCOST}*{ICIVAL.QUANTITY}*{ICIVAL.CONVERSION}
else if valu = 4 then if {ICIVAL.COSTCONV} <> 0 then {ICIVAL.COST1}*{ICIVAL.QUANTITY}*{ICIVAL.CONVERSION}/{ICIVAL.COSTCONV} else {ICIVAL.COST1}*{ICIVAL.QUANTITY}*{ICIVAL.CONVERSION}
else if valu = 5 then if {ICIVAL.COSTCONV} <> 0 then {ICIVAL.COST2}*{ICIVAL.QUANTITY}*{ICIVAL.CONVERSION}/{ICIVAL.COSTCONV} else {ICIVAL.COST2}*{ICIVAL.QUANTITY}*{ICIVAL.CONVERSION}
else if valu = 6 then if {ICIVAL.COSTCONV} <> 0 then {ICIVAL.OPTAMT}*{ICIVAL.QUANTITY}*{ICIVAL.CONVERSION}/{ICIVAL.COSTCONV} else {ICIVAL.OPTAMT}*{ICIVAL.QUANTITY}*{ICIVAL.CONVERSION}
else if valu = 7 then if {ICIVAL.CONVERSION} <> 0 then {ICIVAL.OPTAMT}*{ICIVAL.QUANTITY}*{ICIVAL.CONVERSION}/{ICIVAL.CONVERSION} else {ICIVAL.OPTAMT}*{ICIVAL.QUANTITY}*{ICIVAL.CONVERSION}
else if valu = 8 then if {ICIVAL.COSTCONV} <> 0 then {ICIVAL.LASTCOST}*{ICIVAL.QUANTITY}*{ICIVAL.CONVERSION}/{ICIVAL.COSTCONV} else {ICIVAL.LASTCOST}*{ICIVAL.QUANTITY}*{ICIVAL.CONVERSION}
else if {ICIVAL.BASECONV} <> 0 then {ICIVAL.BASEPRICE}*{ICIVAL.QUANTITY}*{ICIVAL.CONVERSION}/{ICIVAL.BASECONV} else {ICIVAL.BASEPRICE}*{ICIVAL.QUANTITY}*{ICIVAL.CONVERSION}




Print Page | Close Window