I'd like to multiply the quantity value I have stored in my DE by 1.25. The DE field is set to number. I've named the variable @Pens. I created another variable @PensCost to store the value of @Pens x 1.25.

I've tried:

SET @PensCost = Multiply(@Pens, 1.25) 

but I get an error message:

Multiply Parameter Name: Value1 Parameter Ordinal: 1 Parameter Type: Numeric Submitted." What am I doing wrong?

I've used this same format for other products and it's working fine. When I use %%=v(@Pens)=%% it returns the quantity number so I know my variable does have data.

More detailed code:

VAR @Pens, @PensCost
SET @Pens = AttributeValue("PAPERMATE PENS BLUE FINE POINT 15 ct")
SET @PensCost = Multiply(@Pens, 1.25) 
  • 1
    From a quick glance, it should work, however, I would love to see the full code where you're referencing the @Pens variable to the DE field. cheers – Brad Sapkota Dec 13 '20 at 6:38
  • Did you verify if there was the possibility of a null value? If there is no condition to check that, if @Pens is ever null, it will toss an error on the Multiply. – Gortonington Dec 14 '20 at 14:10
  • Thanks but I set the default value of the field to 0. I was able to read the quantity when I wrote %%=v(@Pens)=%% but the multiply function wasn't working. Not sure why just changing the DE field name allowed it to worked. – chelechele Dec 15 '20 at 4:03

I'm posting my solve for anyone else dealing with the same issue. Even though the data extension field was set to Number and I was able to access the value with %%=v(@Pens)=%% I was getting errors on any math function.

All I did was change the field name in the DE to PAPERMATE PENS BLUE 15ct and update

SET @Pens = AttributeValue("PAPERMATE PENS BLUE 15ct") 

It's working now.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.