Important Community update: The process for changing your account details was updated on June 25th. Learn how this impacts your Community experience and the actions we suggest you take to secure your account here.

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Formatting Error (Multi-Field Formula)

knnwndlm
8 - Asteroid

Hi SME,

 

I have a set of numbers - all double - and I'm trying to convert them into currency format.  For example, I have 5235.32342 and want it to show up as $5,235.32.  I used the Multi-Field Formula with the following formula:  '$'+ToString([_CurrentField_],2,1) and I kept the error that says "The formula - field name - resulted in a string but the field is numeric.  Use ToNumber(...) if this is correct.

 

I tried to incorporate the suggest ToNumber into the above formula as follows:  '$'+ToString(ToNumber([_CurrentField_]),2,1).  Now, I got the error that says "The formula - field name - resulted in a string but the field is numeric.  Use ToNumber(...) if this is correct.

 

What am I missing in this error loop?  Any suggestions?

 

Thanks,

K

10 REPLIES 10
Felipe_Ribeir0
16 - Nebula

Hi @knnwndlm 

 

Select the Change Output Type to String. Check the attached workflow if necessary.

 

Felipe_Ribeir0_1-1665438319255.png

Felipe_Ribeir0_2-1665438353101.png

 

 

binuacs
20 - Arcturus

@knnwndlm the same formula is working for me. Can you check the configuration of the given worklow?

 

binuacs_0-1665438283992.png

 

DataNath
17 - Castor

Hey @knnwndlm, did you ensure to set this option in the Multi-Field Formula configuration? If not, the outgoing fields' data type will still be numeric, hence the error:

 

Output MFF as string.png

knnwndlm
8 - Asteroid

Thank you All!  It's missing Output Type - hence, the error.

knnwndlm
8 - Asteroid

Hi All,

 

How do I apply the Round formula to the formatting expression?  I got an error with the following:  '$'+ToString(Round([_CurrentField_]),1),2,1).  The error kept saying wrong number of parameters for the function ROUND.  

 

Thanks,

K

binuacs
20 - Arcturus

@knnwndlm 

 

'$'+toSTring(Round([_CurrentField_],0.01),2,1)
knnwndlm
8 - Asteroid

@binuacs 

 

When I created a Var % field as a Fixed Decimal, I tried to apply the Round formula in the Formula tool as follows:  ToString(Round([VAR %]*100,0.1))+'%'.  I kept getting the error "The formula VAR % resulted in a string but the field is numeric.  Use ToNumber(...) if this is correct."

 

I don't understand this. It's already numeric so why is the error telling me to add ToNumber().  If I added it, I got the same error. What I want to get is to convert something like 0.0357 tp 3.6%

 

Please help me understand.

 

Thanks,

Konn

binuacs
20 - Arcturus

@knnwndlm Check your data type of the variable VAR%, make sure that it is string type

 

binuacs_0-1665440768233.png

 

knnwndlm
8 - Asteroid

Hi @binuacs 

 

Interesting!  That's almost exactly what I have and still got the error.  I couldn't change the Data type to String.  It's got stuck as Fixed Decimal.

 

I was able to get it to work with ToString(Round([_CurrentField_]*100,0.1),1,1)+'%' in the Multi-Field Formula tool.  Still don't understand why Formula tool's not working.

 

Thanks,

Konn

Labels