Hello
I figured it out!
Found the solution here
The solution is
STARTSWITH ["BR","DP"]
then I fiddled with the parenthesis.
Thank you all for your help!
Hi Rony,
Try:
IF {'Sales_Data_'.Product Code} STARTSWITH "BR" THEN {'Sales_Data_'.Qty} & if({'Sales_Data_'.Qty} = 1 then " Bottle" Else " Bottles") ELSE IF NOT ({'Sales_Data_'.Product Code} STARTSWITH "BR") OR STARTSWITH "DP" THEN {'Sales_Data_'.Qty} * {'Bacchus_Vinos_Costing_Sheet_'.Units_per_Case} & if({'Sales_Data_'.Qty} * {'Bacchus_Vinos_Costing_Sheet_'.Units_per_Case} = 1 then " Case" Else " Cases")
-Abhilash
Thank you again.
Upon checking it for error before saving, I get the following error message:
"The ) is missing" on the bold THEN below.
IF {'Sales_Data_'.Product Code} STARTSWITH "BR"
THEN {'Sales_Data_'.Qty} & IF ({'Sales_Data_'.Qty} = 1 THEN "Bottle" ELSE " Bottles")
ELSE IF NOT ({'Sales_Data_'.Product Code} STARTSWITH "BR") OR STARTSWITH "DP"
THEN {'Sales_Data_'.Qty} * {'Bacchus_Vinos_Costing_Sheet_'.Units_per_Case} & IF ({'Sales_Data_'.Qty} * {'Bacchus_Vinos_Costing_Sheet_'.Units_per_Case} = 1
THEN " Case" ELSE (" Cases")
Hi,
On the second line, the open bracket should be before the IF like:
(IF {'Sales_Data_'.Qty} = 1 THEN "Bottle" ELSE " Bottles")
Brian
Thank you Brian.
After amending the formula as per your instruction, I get an error message that "A number, currency amound, boolean, date, time, date-time, or string is expected here" on the bold below:
IF {'Sales_Data_'.Product Code} STARTSWITH "BR"
THEN {'Sales_Data_'.Qty} & (if{'Sales_Data_'.Qty} = 1 then " Bottle" Else " Bottles")
ELSE IF NOT ({'Sales_Data_'.Product Code} STARTSWITH "BR") OR STARTSWITH "DP"
THEN {'Sales_Data_'.Qty} * {'Bacchus_Vinos_Costing_Sheet_'.Units_per_Case} & if({'Sales_Data_'.Qty} * {'Bacchus_Vinos_Costing_Sheet_'.Units_per_Case} = 1 then " Case" Else " Cases")
Add comment