Hi Rikke,
I'm afraid there is no supported "one-step" solution for what you are looking for.
One possible solution would be:
- Introduce a temporary table in your database (Oracle or whatever it is) on an Order level.
- Use an Export or Process node to export data to that table with selected Orders as a first step. \
- Have a view created in a database on top of that table that implements the aggregation you need. Oracle has a function "LISTAGG", other databases should have similar aggregate functions.
- Infomap this view back to SAS MA, so it can be used for subsequent communication on a Customer level
Another possible solution would be to execute a communication on an Order level, and then use a Post Process to aggregate output records. Looks simpler and cleaner, but will leave the contact history recorded at the Order level, which may or may not be appropriate in your situation.
In theory, there exists another solution - very tricky and obscure. If your database supports a simple list aggregation function (like older Oracle, up until 11g2, had "wm_concat" function), you could try using "SQL_FUNCTIONS=EXTERNAL_APPEND" libname option to "add" a newSAS SQL function alias that corresponds to that database function, with Function Category = AGGREGATE. And then try calling it from SAS MA Calculated Item. It's a very deep and scary stuff and I highly doubt it was ever tested to be used that way. You can try at your own risk and tell us the results though. I'm not affiliated with SAS Technical Support, but in their place, i'd tell that such use case isn't supported. Newer Oracle versions (12c) do not have a simple wm_contact function and have a window function LISTAGG instead. Obviously, SAS external_append functionality cannot be extended to window functions. Not sure about other databases.
Good luck!
-------
Dmitriy Alergant, Tier One Analytics