Skip to main content
Participant
August 31, 2020
Answered

The value entered does not match the format of the field

  • August 31, 2020
  • 2 replies
  • 1067 views

This error message is coming up after trying to complete the following division equation to create a Percentage (which is formatted to percentage with two decimals):

Openended/(Closedended+Openended) in a simplified field notation.

I have tried multiple custom calculation scripts that create a null or 0 or blank field because the Openended and Closedended both are formatted to number; however, I continue to get the same error message.

 

This topic has been closed for replies.
Correct answer Nesa Nurani

Try use this code in your percentage fields as "Custom format script":

event.value = util.printf("%,0.2f%",event.value);

2 replies

Bernd Alheit
Community Expert
Community Expert
August 31, 2020

You will get the message when you divide by zero.

Nesa Nurani
Community Expert
Community Expert
August 31, 2020

You can use this as "Custom Format Script" of both Openended and Closedended fields:
AFNumber_Format(2, 0, 0, 0, "", true);

Participant
August 31, 2020

I have come to realize this error message is also connected to when I create additional fields for other percentages using the same equation with different field names; somehow they are linking together.

For example:

(Openended/(Closedended+Openended) = Percentage of Awareness Questions

(OpenendedAn/(ClosedendedAn+OpenendedAn) = Percentage of Analysis Questions. 

If I only calculate the Percentage of Awareness Questions this error message will still pop-up but only if I delete/clear information in the Opendened or Closedended fields.

As soon as I create the Percentage of Analysis Questions field and try to complete the calculation. This error message comes up twice:

- The value entered does not match the format of the field [ Percentage of Awareness Questions ]

-  The value entered does not match the format of the field [ Percentage of Analysis Questions ]

Any help would be greatly appreciated. My initial assumption is a "custom calculation script" is necessary, given that the error is occurring even using the "custom format script"

Nesa Nurani
Community Expert
Nesa NuraniCommunity ExpertCorrect answer
Community Expert
August 31, 2020

Try use this code in your percentage fields as "Custom format script":

event.value = util.printf("%,0.2f%",event.value);