on 10-01-2009 11:45 PM
split({description field}," ")[1]
I'm wondering if and how I could use this to solve another issue. Perhaps I should start anopther thread but it is along the same lines as this one.
We need to separate out the work done by the contractors and the work done by the Feds. All contractors have CTR in the middle of their name though some, because Lotus Notes won't allow duplicate names in the directory, use their middle initial. So in other words, my name is
Barbara CTR Buckley
If I were to use my middle initial my name would be:
Barbara A-CTR Buckley
Could I use this formula to somehow pull out all the contractor work and if so, how would I go about accounting for both situations (middle initial and no middle initial)? If not what would be the best way to do this?
Thanks
Barb
There is no one easy way to do this. As you find exceptions you will have to keep adding it to the conditions. Having said that, if CTR will be part of the middle name will it always have a hyphen? If so, that will make things easier. Also check CTR with a space in front and back. For example:
if instr({description.field}," ctr ") > 0 OR instr({description.field},"-ctr ") > 0 then
"CONTRACTOR"
else
"FEDS";
The first INSTR condition should take care of names such as: Barbara CTR Buckley
The second INSTR condition should take care of names such as: Barbara A-CTR Buckley
case sensitivity depends on whether under File | Report Options you have the box next to "Database server is case-insensitive" checked or not.
Edited by: Sanjay Kodidine on Oct 2, 2009 7:50 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If I understood correctly I think you want to split the records into two groups in which you have contractors and feds.
Contractors will have CTR in their names. So you need to create a formula like this
if instr({name field},"CTR")>0 then
"CONTRACTOR"
else
"FEDS"
now insert a group on this formula so that all the contractors group into one and feds into other.
HTH
Raghavendra
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.