Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7963 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hi everyone!

I am importing a set of data. My fields are number. The data is listed as $73.15. I have written a script to remove the $ and change the amount to a minus. The script does remove the $ but doesn't add the minus! I assume it's because my fields are numeric? Any suggestions on how to accomplish this?

GoTo Record/Request/Page

[ First ]

Loop

Set Field [ Charges, Substitute( Charges, "$" , "-" ) ]

Set Field [ AmountAllowed, Substitute( AmountAllowed, "$" , "-") ]

Set Field [ Payment, Substitute( Payment, "$", "-") ]

Set Field [ CoPay, Substitute( CoPay, "$", "-") ]

Set Field [ Withhold, Substitute( Withhold, "$", "-") ]

Set Field [ FFSEquity, Substitute( FFSEquity, "$", "-") ]

Set Field [ COBDeduct, Substitute( COBDeduct, "$", "-") ]

Go to Record/Request/Page

[ Next, Exit after last ]

End Loop

LaRetta

Posted

Hi Ugo!

Well that didn't work. I even tried "Charges" - "Charges" and that made all numbers "0" YIKES! This shouldn't be difficult! crazy.gif

UPDATE: Duh! Charges - Charges = 0 of course blush.gif

I changed it to Charges - Charges * 2 and it worked!! Okay, okay, I've been up all night!

LaRetta

Posted

Thanks Ugo!

Yes, I think I've just reached brain-death. Of course it works when I enter it right grin.gif Thanks for helping!

LaRetta

Posted

Hi LaRetta, Ugo

Well, as I see the things (laRetta), the script you gave fail to success simply because those fields are numbers and when casting the contents of the field to number (and that's what is happening as the result of set field with numeric result of calculation) the $ signs(or any other non numeric char except -) is droped and there is nothing to replace with "-" .

So instead use simply:

Set Field[theNumericField,(-1)*theNumericField]

Dj

Posted

Hi Ugo and DJ!

That worked perfectly! Thanks to both of you. Actually, using SET in this way has sparked quite a bit of interest in me. shocked.gif

LaRetta

This topic is 7963 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.