Skip to Content
0
Former Member
Jan 17, 2017 at 12:38 AM

Concatenate Rows excluding null from another column on the same line

58 Views

Hi

i am trying to concatenate strings from a number of rows but only where another column on the line is not null. Here is below what i have so far

//formula_NameOfPerson
if {job} = "" then "" else {name}
//formula_header

WhilePrintingRecords; 
StringVar Array reset; StringVar Array names:=reset; True; 
//formula_detail

WhilePrintingRecords;
StringVar Array names;
Redim Preserve names[Ubound(names)+1];
names[Ubound(names)]:=trim({@formula_NameOfPerson});
//formula_footer

StringVar Array names;Join(names, ",");
WhilePrintingRecords;

Currently the output is occuring

John,Sarah,,,,,,David,,,,Mike,,,,,,,,Sam,,,

what i want to it output is

John,Sarah,David,Mike,Same

Any advice would be much appreciated.

kind regards

David