Hi Experts,
I have a requirement to concatenate multiple values into one cell and have them grouped by a primary dimension. I have seen a solution for BOXI 3.1 but when I try it in 4.1, I don't seem to get the same results. I was wondering if there was a new work around for this solution?
Here is a sample of how my data is structured...
Animal | Owners |
Dogs | Bob |
Cats | Matt |
Goats | Mike |
Chickens | Jake |
Dogs | Ryan |
Cats | Brian |
Goats | Jeff |
Chickens | Christine |
Dogs | Alex |
Goats | Olaf |
Goats | Victor |
Cats | Vanessa |
Cats | Lilly |
Cats | Mackenzie |
Cats | Jackie |
Here is what I am trying to accomplish...
Animal | Owners |
Dogs | Bob, Ryan, Alex |
Cats | Matt, Brian, Vanessa, Lilly, Mackenzie, Jackie |
Goats | Mike, Victor, Olaf, Jeff |
Chickens | Christine |
The solution I found that doesn't work in 4.1 is this...
· Create a variable [VAR Max CATEGORY = Max([Category]) In ([Lines])to find the maximum CATEGORY with respect to each Line
· Create a variable [VAR Concat CATEGORY = CATEGORY +", "+ Previous(Self), to concatenate the CATEGORY value with it's previous row value
· Create a 3rd variable [VAR Max Concat CATEGORY = [VAR Concat CATEGORY Where ([Category]=[VAR Max Category]). This variable basically gives only those rows of [VAR Concat CATEGORY where the value of the CATEGORY is maximum for that particular Line
· Create a variable[VAR CATEGORY =If(IsNull(Previous([VAR Max Concat Category]));Substr([VAR Max Concat Category];1;Length([VAR Max Concat Category])-2);Substr([VAR Max Concat Category];1;Pos([VAR Max Concat Category];Previous([VAR Max Concat Category]))-3))
Basically, the formula checks if the previous value of VAR Max Concat Category is NULL.
Thanks in advance!
Best,
Ryan