Topic
8 replies Latest Post - ‏2012-12-17T20:30:27Z by SystemAdmin
SystemAdmin
SystemAdmin
294 Posts
ACCEPTED ANSWER

Pinned topic Simple data rule but having wrong output

‏2012-12-17T16:10:34Z |
I am new to the Infomation Analyzer, and I created a simple data rule to retrieve the student address who lives in Brooklyn.
if city=B then address_line1=address_line1

I then binded the values

Name Rule Definition Data Type Binding
address_line1 Adult_Address Any ADDRESS.ADDRESS_LINE_1
b Adult_Address Any BROOKLYN
city Adult_Address Any ADDRESS.CITY

This is the rule after the binding

if ODS_PROD."ADDRESS".CITY=BROOKLYN then ODS_PROD."ADDRESS".ADDRESS_LINE_1=ODS_PROD."ADDRESS".ADDRESS_LINE_1

but when I viewed the test results , It’s not just returning Brooklyn. Its returning all the cities.
Can you let me know where exactly I went wrong please?
Updated on 2012-12-17T20:30:27Z at 2012-12-17T20:30:27Z by SystemAdmin
  • smithha
    smithha
    162 Posts
    ACCEPTED ANSWER

    Re: Simple data rule but having wrong output

    ‏2012-12-17T16:41:12Z  in response to SystemAdmin
    I think the issue is with the binding of the variable "b". It looks like you are connecting that with a literal, but not using single quotes. Make sure you enter Brooklyn with quote marks.

    Or you might just try modifying the rule definition first to be:
    if city='BROOKLYN' then address_line1=address_line1

    Test that out and ensure it is working. Then switch to using a variable such as "b" when you are satisfied it is returning expected results. http://And also remember that if the data contains mixed case, then you may need to include a case function to catch all the desired records.

    Harald
    • SystemAdmin
      SystemAdmin
      294 Posts
      ACCEPTED ANSWER

      Re: Simple data rule but having wrong output

      ‏2012-12-17T16:54:54Z  in response to smithha
      Thanks Harald for your replay.

      I modified the rule definition as you suggested:
      if city='BROOKLYN' then address_line1=address_line1

      but the same problem still returning all cities,
      I also binded it to the string with a single qoute 'BROOKLYN' but it still returning all cities.

      your feedback is really appreciated,

      Sami.
      • RobertDickson
        RobertDickson
        65 Posts
        ACCEPTED ANSWER

        Re: Simple data rule but having wrong output

        ‏2012-12-17T19:21:23Z  in response to SystemAdmin
        Hi Sami,

        What is your 'Output' selection? Are you asking for 'All' records, or only the ones that 'Meet' your rule?

        Also, for your requirement, I think you can just create a rule city='BROOKLYN', and then output the records that 'meet' your condition.

        Regards,
        Robert
        • SystemAdmin
          SystemAdmin
          294 Posts
          ACCEPTED ANSWER

          Re: Simple data rule but having wrong output

          ‏2012-12-17T20:11:18Z  in response to RobertDickson
          Thanks Robert for your replay.

          I am asking for the records that only met. but its retrieving all the records.
          • RobertDickson
            RobertDickson
            65 Posts
            ACCEPTED ANSWER

            Re: Simple data rule but having wrong output

            ‏2012-12-17T20:14:30Z  in response to SystemAdmin
            Hi Sami,

            Try changing your rule to city='BROOKLYN'. Remove the 'If/Then' and let us know how you make out.

            Regards,
            Robert
            • SystemAdmin
              SystemAdmin
              294 Posts
              ACCEPTED ANSWER

              Re: Simple data rule but having wrong output

              ‏2012-12-17T20:23:50Z  in response to RobertDickson
              Hi Robert,

              I changed it to city='BROOKLYN' without 'if / then', and it works, but I need to retrive the address for the student who lives in Brooklyn

              Thanks for your support
              • RobertDickson
                RobertDickson
                65 Posts
                ACCEPTED ANSWER

                Re: Simple data rule but having wrong output

                ‏2012-12-17T20:26:23Z  in response to SystemAdmin
                Hi Sami,

                Ok - you're almost there :)

                Assuming 'student who lives in Brooklyn' means 'city='BROOKLYN', then...

                You can control the output columns that come back from a rule. Tell Information Analyzer that you want the address column (and any others you desire) and you should be good to go!

                Regards,
                Robert
                • SystemAdmin
                  SystemAdmin
                  294 Posts
                  ACCEPTED ANSWER

                  Re: Simple data rule but having wrong output

                  ‏2012-12-17T20:30:27Z  in response to RobertDickson
                  It works..
                  Many thanks to Mr.Robert and everybody
                  I appreciate it