3 Replies Latest reply: May 15, 2014 9:58 AM by todd _ RSS

    using an IF statement to copy a value from one cell to another

    todd _

      Tried searching for something similar, but am not lucking out.  I have Monarch Pro, vers 8.01.

       

      I have a file with customer and guarantor names and the SSN's of both.  Usually.  In some cases, the customer and guarantor are the same, and as a result of the system I'm coverting the data into, I need to copy the SSN into both the customer_SSN and guarantor_SSN fields.

       

      I've tried the following IF statement with Monarch in the c_ssn (customer SSN) field, but am getting an "operand types" error:

       

      IF(g_last=c_last .And. g_first=g_first,g_ssn,"")

       

      Any thoughts?  Can I even do this with just an IF statement?  thanks for any help  - Todd

        • using an IF statement to copy a value from one cell to another
          todd _

          can't type today -- the IF statement is

           

          IF(g_last=c_last .And. g_first=c_first,g_ssn,"")

          • using an IF statement to copy a value from one cell to another
            Grant Perkins

            Todd,

             

            I am not sure I understand all of the details of the data and the transaction you want to perform.

             

            As I read it you have a Customer (c) and a customer SSN (c_ssn) and the same for guarantor (g and g_ssn)

             

            I assume you always have c and c_ssn but sometimes g and g_ssn don't exist? Or they do exist but, g being somehow identifiable as the same as c you need to pass the c_ssn rather than the g_ssn to the new database.

             

            Is it something like that?

             

            In your formula I don't understand where the 'lasts' and 'firsts' come from.

             

            I think what you need is a calculated field that uses the input data, but not necessarily the g_ssn data field even if it is populated, and becomes the actual field you will use for g_ssn.

             

            So if I refer to the new field as g_ssn_calc the formual would be something like;

             

            IF(g_ssn=" ",c_ssn,IF(g=c,c_ssn,g_ssn))

             

            So that means;

             

            If g_ssn is blank, use c_ssn.

             

            Otherwise, IF guarantor and customer are the same, use the c_ssn value.

             

            If neither of the previous conditions are true, use the g_ssn value.

             

            Assessing whether g=c may be a little more complex that shown above but that is a data issue and not an issue of the principle!

             

            Your export should then use the new g_ssn_calc field and not the g_ssn field originally imported.

             

            Does that make sense?

             

             

            Have fun.

             

             

            Grant

            • using an IF statement to copy a value from one cell to another
              todd _

              Yes, it does.  Thank you!