Jump to content
Salesforce and other SMB Solutions are coming soon. ×

problem with a number field


aaroncp

Recommended Posts

Good morning. I'm having problems with a field in our company database that holds a number value.

 

We import the data to this database from several sources and sometimes the data we import has a dollar sign ($) and sometimes it doesn't.

 

So, some records in our database have dollar signs and some don't.

 

How do I go through all the records in our database and remove the $ from that number field in all records that contain it so that I'm working with just plain numbers?

 

Thanks,

Aaron

Link to comment
Share on other sites

How do I go through all the records in our database and remove the $ from that number field in all records that contain it so that I'm working with just plain numbers?

 

One way would be to use a looping script that sets the field to

Filter ( YourNumberField ; "0123456789." )

 

If you don't know how to set that up ask here.

Link to comment
Share on other sites

One way would be to use a looping script that sets the field to

Filter ( YourNumberField ; "0123456789." )

 

If you don't know how to set that up ask here.

 

That sounds like what I need to do. I tried searching for "$" in the field but it never finds any even though I can see them.

 

Can you tell me how to set up that field filter script.

 

Aaron

Link to comment
Share on other sites

1. Backup your database before you begin!

 

2. Make the following script:

Go to Record/Request/Page [First]

Loop

Set Field [YourNumberField ; Filter ( YourNumberField ; "0123456789." )]

Go to Record/Request/Page [Next;Exit after last]

End Loop

 

3. Go to a layout that contains the field. Make sure the layout is based on the same same table that the field is in (if you're not sure how to check, ask here).

 

4. Temporarily change the field type to TEXT (if you're not sure how to check, ask here).

 

5. You can now search for "$" in the field.

 

6. While still on the same layout, run the script.

 

7. Change the field type back to NUMBER.

Link to comment
Share on other sites

We import the data to this database from several sources and sometimes the data we import has a dollar sign ($) and sometimes it doesn't.

 

You did not say what the data source is, but it might be possible to strip the $ before you import.

Link to comment
Share on other sites

It's a pricing spreadsheet from several of our suppliers (some include the $, most don't) but from now on I'll be deleting all the $'s from the excel spreadsheet before importing.

Link to comment
Share on other sites

1. Backup your database before you begin!

 

2. Make the following script:

Go to Record/Request/Page [First]

Loop

Set Field [YourNumberField ; Filter ( YourNumberField ; "0123456789." )]

Go to Record/Request/Page [Next;Exit after last]

End Loop

 

3. Go to a layout that contains the field. Make sure the layout is based on the same same table that the field is in (if you're not sure how to check, ask here).

 

4. Temporarily change the field type to TEXT (if you're not sure how to check, ask here).

 

5. You can now search for "$" in the field.

 

6. While still on the same layout, run the script.

 

7. Change the field type back to NUMBER.

#1 is good advice!

#3 the layout does not necessarily need to contain the field - it just needs to be based on the right table. I suppose if you can see the field, you are pretty sure that you are on a good layout. ;)

#4 why change the field to text? Is it to search for records with $ and therefore cut down the time to run the script? I would show all records, skip straight to #6 and run the script - then all records would be fixed. #7 then not required. smiley_cool

 

For future data entry and imports, you might want to set an auto-entered calculation that replaces existing data = Filter ( YourNumberField ; "0123456789." )

Link to comment
Share on other sites

This thread is quite old. Please start a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

Terms of Use