Hi All,
I have an incoming file with 4 fields. I need to check each value in field1 has 10 specific values in field3. If atleast one is missing from field3, file should not be processed.
Can someone please help me to achieve this.
Appreciate your help.
Thanks
Logic Needed
Moderators: chulett, rschirm, roy
Below is an example of data. I have made up some data. Field2, even if it has 10 or 20 distinct values, it should definitely have the 10 distinct values that I am looking for.
Field1 Field2
1CP001 ABC
1CP001 BCD
1CP001 CDE
1CP001 DEF
1CP001 EFG
1CP001 FGH
1CP001 GHI
1CP001 HIJ
1CP001 IJK
1CP001 JKL
1CP002 ABC
continues like this
Field1 Field2
1CP001 ABC
1CP001 BCD
1CP001 CDE
1CP001 DEF
1CP001 EFG
1CP001 FGH
1CP001 GHI
1CP001 HIJ
1CP001 IJK
1CP001 JKL
1CP002 ABC
continues like this
Your original post mentions that you have "four fields" and the logic needs to check field1 against field3... and now your example has two fields. So, is field2 in your example the same as field3 in your first post?
And are you looking for 10 distinct values regardless of actual value or does your "distinct values that I am looking for" comment mean you have a list of 10 specific values that need to be there or the file "should not be processed"? We'll probably need to talk about what exactly that means but let's start with this.
Not a big fan of made up example data, btw.
![Confused :?](./images/smilies/icon_confused.gif)
Not a big fan of made up example data, btw.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
this sounds like something you would do easier in SQL, counting the values in one column to see if you have exactly 10 distinct values in the second column.
So if they are in a file, poke them into a temporary staging table, run a sql statement that validates it, and proceed could be a simple design?
If it passes that test you can check that each value is in a specific list with a lookup stage to finish up the checking, if I understood the requirement.
So if they are in a file, poke them into a temporary staging table, run a sql statement that validates it, and proceed could be a simple design?
If it passes that test you can check that each value is in a specific list with a lookup stage to finish up the checking, if I understood the requirement.
Or just use a lookup against a row generator with list of reference data.
Nice thing about Row Generator, you can use parameters in some cases to achieve what you want.
Also could use a sequential file, if you can manage that (some customers do not like the idea of a random text file in the production environment).
-T.J.
Nice thing about Row Generator, you can use parameters in some cases to achieve what you want.
Also could use a sequential file, if you can manage that (some customers do not like the idea of a random text file in the production environment).
-T.J.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: