Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Getting array entry..

Posted on 2004-10-01
12
202 Views
Last Modified: 2013-12-18
i have 2 multi value fields that contain similar or related value for example Field A  contains Department Name and Field B Contains Department Manager.

Field A(Department)              Field B(Department Manager)
IT  Dept                                Joe Depth
HR Dept                                Louie HArd
Admin Dept                           Henry See
Accounting Dept                     Chu Yuan



now i need to create a Combobox(using DBcolumn) that contain the list of all Department(Field A) and if i select 1 value i will get the designated department manager..


how can i do that?

thanks..
0
Comment
Question by:amd1979
  • 5
  • 4
  • 3
12 Comments
 
LVL 46

Accepted Solution

by:
Sjef Bosman earned 250 total points
ID: 12199346
In LotusScript or in Formula?

Formula example:
   
    combined:= AllA + "~" + AllB;
   
The value for B will then be:
    x:= @Trim(@Right(AllB; A + "~"));
    @If(@IsError(x); ""; x)

combined will contain a list of strings like
    IT  Dept~Joe Depth
    HR Dept~Louie HArd
    Admin Dept~Henry See
    Accounting Dept~Chu Yuan

If A contains HR Dept, then the @Right will return "":"Louie HArd":"":"" and the @Trim will reduce that to onlu Louie HArd
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 12199425
Here my proposal (hello sjef :)

Put this int your Department DialogList field Choices @formula:
FieldA

And put this in the InputTranslation @formula of the Department field:

keyPairs:=@Implode(FieldA+"="+FieldB;";");
@SetField("Manager";@Left(@Right(keyPairs;Department+"=")+";";";"));
Department


0
 
LVL 63

Expert Comment

by:Zvonko
ID: 12199503
Perhaps this formula for InputTranslation is slightly more fool proof:

keyPairs:=";"+@Implode(FieldA+"="+FieldB;";");
@SetField("Manager";@Left(@Right(keyPairs;";"+Department+"=")+";";";"));
Department

0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
LVL 63

Expert Comment

by:Zvonko
ID: 12199566
Sorry, it can be simplified to this:

keyPairs:=FieldA+"="+FieldB;
@SetField("Manager";@Trim(@Right(keyPairs;Department+"=")));
Department

(wasn't that what sjef told you? uhps :)
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 12199642
LOL!
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 12199674
:-)
0
 

Author Comment

by:amd1979
ID: 12213981
Field A is an array a sigle fields contains 3  or more Deprtment on a sigle document same as Filed B i only seperated them by newline..

ithink i need to determine the element number of both fields.. if i select department name, on field A i will get the corresponding element number on field B..


i want to show the value of 2 fields in seperate fields if i select department (using dblookup)
the computed field for dapartment manager will get the value of it using DB lookup also..





hope it is now more clearer..

thanks



0
 

Author Comment

by:amd1979
ID: 12214260
thanks i got it
0
 

Author Comment

by:amd1979
ID: 12235468
please help me follow up to this question..

now i need to compare the location of two array, similar to my first question

i have 2 multi value fields value  separated by semicolon

the first field contain name and the second field contain score(hidden fields)

now i need to select the first field using combobox  and the contain of second field will display on the the computed fields.


thanks..

amd

0
 

Author Comment

by:amd1979
ID: 12235516
this fields are hidden
First field        Second field
Ariel               11 points
Jon                 20 Points
Nesa               13 points
this two field have alway equal value

now im going to pass the value of hidden first field to Combobox and if i select any value the corresponding score will be displayed on the computed text..








0
 
LVL 63

Expert Comment

by:Zvonko
ID: 12235535
I do not see the difference?
Basically it same as this:

keyPairs:=namesListField+"="+pointsListField;
@SetField("Points";@Trim(@Right(keyPairs;singleName+"=")));
singleName


The upper assumes this field names:
1.) Field with all Names as multiple values: namesListField
2.) Field with all Points as multiple values: pointsListField
3.) Field with the searchin Name value: singleName
4.) Field for the target Point value: Points


0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 12235700
Better post a new question...
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question