Link to home
Start Free TrialLog in
Avatar of David Schmalzer
David SchmalzerFlag for United States of America

asked on

Multiple fields in 1 view column

I have a form called Yieldsheet1 with 2 fields called so and so2. I have 2 agents that each run an @dblookup. They find data in another database based on the keyword from a field on Yieldsheet1 called batch. Now after the dblookups are run, it may populate multiple data in field so and field so2 and it also may produce Entry not found in index. My problem is the view. I need to have all data from so and so2 in one column in a view and seen as separate documents and if there are any errors display "Na".
Avatar of marilyng
marilyng

Create a computed field called "so_parsed", multivalue, separate each value with newline on your form.

Then the formula (with assistance from a previous sjef post)

FullList:= so:so2 + "|";
x:= "|"+ @Right("~" + FullList; "~|");
y:=@Replacesubstring(@Replace(FullList; x; "NA");"|";"");
y


The view column formula should be: "so_parsed", separate values with new line.

schmad01,

1 use @IfError on you so and field so2 field to trap "Entry not found in index"
2. in your view column property (sorting tab), tick "Show multiple values as separate entries"

hope this helps.
ASKER CERTIFIED SOLUTION
Avatar of Steve Knight
Steve Knight
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks guys for the error trapping.. !
Avatar of David Schmalzer

ASKER

So which should I use for the view column formula:  so_parsed  or  @Trim(@If(!@IsError(so);so;""):@If(!@IsError(so2);so2;""));   ?
Well the first stores the data again in the document so is a one-off process for you to refresh all your exisgting doxuments to include this field then you can set the view column to the fieldname.  The second means it has to be recalculated every time the view is built and therefore gives some minor extra load on the server.  

To get the na you asked for too just amend as :

@If(!@IsError(so);so;"N/A"):@If(!@IsError(so2);so2;"N/A")

Steve
The only reason why  I didn't suggest this is because I don't know how many values are going to be in the so/so2 fields.   When the list is unknown, then you shouldn't try to parse it in a view.  :)
Ah. makes sense. Shouldn't be too much data, though. Will try everything tomorrow.  Thanks everyone!
Famous last words... then a few years down the line, the application stops running.  :))  (had that happen).  At any rate, several good suggestions here for you to try.
I know for a fact that the data will not grow past a certain point. So, that is why I used this suggestion.  Thank you all.
Well thanks for the points, take note of marilyng's comments though :-)

Steve
Absolutely. I take note of everyone's comments.