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

script - Importing into field using different calculation


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

Recommended Posts

Posted

Hi,

I have data that I want to import into the same field, where I currently have a calculation where the last name gets stripped out. (eg. Bill_Smith) so only Smith appears in the field (I use the "middle"/'position' with "_" to only have "Smith" appear in the field. The question is that some of the data that I am importing has the 1st and last name switched around (eg. Jones_Nancy). So I was wondering if there is a script solution to this problem. I have got the calculation to strip out the last name in the "Jones_Nancy" example. But through the script, is there a way to select which way I import into the same field? These old data files that I am importing, I now which name format each data file is, based on which company created the data files. Is there a script solution? I am not sure how to approach this problem. I am thinking I might be making it more complicated than it is. Any comments on this problem would be great, so I can get my head around it.

Posted

I'd import the name and the source company. Then I'd calc the last name field. The calc would be a case statement, along the lines: case (

company="ABC" or company="NBC", your parsing calc for last_first;

company="XY"; your parsing calc for first_last

)

Posted

Or place global text (called gParseMethod) on layout (or capture in Custom Dialog) and, following Barbara's method of capturing name and source company, calculation would be:

Case (

gParseMethod = last_first ; your parsing calc for last_first ;

gParseMethod = first_last ; your parsing calc for first_last

)

... this will save hard-coding company names since you'll know which parse method you will require at the time of import then loop set your name fields after each import set with this calc. I agree that you should capture both name and source company during the import as well so you have a reference in case there is a problem. :smile2:

This topic is 5511 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.