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".
schmad01Asked:
Who is Participating?
 
Steve KnightIT ConsultancyCommented:
i.e. in view column:

@Trim(@If(!@IsError(so);so;""):@If(!@IsError(so2);so2;""));
0
 
marilyngCommented:
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.

0
 
cezarFCommented:
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.
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
marilyngCommented:
Thanks guys for the error trapping.. !
0
 
schmad01Author Commented:
So which should I use for the view column formula:  so_parsed  or  @Trim(@If(!@IsError(so);so;""):@If(!@IsError(so2);so2;""));   ?
0
 
Steve KnightIT ConsultancyCommented:
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
0
 
marilyngCommented:
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.  :)
0
 
schmad01Author Commented:
Ah. makes sense. Shouldn't be too much data, though. Will try everything tomorrow.  Thanks everyone!
0
 
marilyngCommented:
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.
0
 
schmad01Author Commented:
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.
0
 
Steve KnightIT ConsultancyCommented:
Well thanks for the points, take note of marilyng's comments though :-)

Steve
0
 
schmad01Author Commented:
Absolutely. I take note of everyone's comments.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.