Originally posted by: tjnelso
Suppose I have a tupleset like the one shown below.
tuple def = {string strA; string strB;};
{def} data = {
<"cat", "A">
<"cat", "B">
<"cat", "C">
<"cat", "A;B">
<"cat", "A;C">
<"dog", "A">
<"dog", "C">
<"dog", "A;C">
};
Is there a way to manipulate it using OPL to generate a new tupleset like the one that follows?
{def} nData = {
<"cat", "A;B;C">
<"dog", "A;C">
}
I can count the number of tuples in the original set that contain any specific value of strB and use that information to combine some of the rows. If I keep only items that appear once then I can get to this tuple:
{def} nDataAttempt = {
<"cat", "A;B">
<"cat", "A;C">
<"dog", "A;C">
}
Is there a way to further combine the tuples in nDataAttempt to get nData? I can't see how because I don't have the desired values of strB already preexisting, but I'm hopeful there is a way to create them by concatenation (either explicit or implicit).
#DecisionOptimization#OPLusingCPLEXOptimizer