cancel
Showing results for 
Search instead for 
Did you mean: 

All posibility combination in a Collection

NazaretMartine1
Level 3
Hi,

I am working with blueprism and I have a smallproblem.

I have a collection with several columns related to finances and I need to find compensation. At this point, I need to know all the possible combinations within my collection, that is, if the collection has 10 lines I need to know all the possible combinations between those 10 lines (line 1 with line 2 would be a combination, but it would also be a combination to join the first 8 lines).

The collection with which we work can be 2 lines or 500, so I think that with code it would be faster.

can you help me, friends?

Thank you so much.
5 REPLIES 5

ewilson
Staff
Staff
@Nazaret Martinez Bernal,

What is the definition of a "combination" here? You're talking about lines and columns. Is a combination taking every column from line X and adding it to every column of line Z? Is it just appending the columns of one line to the columns of every other line? There's quite a bit of ambiguity here. Can you post an actual example (maybe in Excel) with some sample data?

Cheers,
Eric​

NazaretMartine1
Level 3
Hi @Eric Wilson,

Sorry.

I need all combinations possibles between rows. For example, in a collection with 4 lines i can...

Line 1, Line 2,
Line 1, Line 3,
Line 1, Line 4,
Line 2, Line 3,
Line 2, Line 4,
Line 3, Line 4,
Line 1, Line 2, Line 3,
Line 1, Line 3, Line 4,
Line 2, Line 3,Line 4,
Line 1, Line 2, Line 3, Line 4
.
.
.

Thank you.​

John__Carter
Staff
Staff
I think the number could be very large and probably too big for a collection. Can you explain the use case?

ewilson
Staff
Staff
@Nazaret Martinez Bernal,

I'm still not entirely clear on your definition of a combination. Does this mean take the contents of row 1 and append the contents of row 2 to create a new row in a different Collection?

Ex. - We have Collection A, our raw data collection, with 3 columns and 3 rows defined in it. Then we have Collection B, which is our results/output collection.
Collection A
Row 1 = 12, 223, 456
Row 2 = 3, 65, 243 
Row 3 = 99, 101, 200
 
After running the "combination" do we end up with
Collection B
Row 1 (Collection A R1) = 12, 223, 456
Row 2 (Collection A R1, R2) = 12, 223, 456, 3, 65, 243
Row 3 (Collection A R1, R2, R3) = 12, 223, 456, 3, 65, 243, 99, 101, 200
Row 4 (Collection A R1, R3) = 12, 223, 456, 99, 101, 200 
Row 5 (Collection A R2) = 3, 65, 243
Row 6 (Collection A R2, R3) = 3, 65, 243, 99, 101, 200
Row 7 (Collection A R3) = 99, 101, 200

Or are you looking to perform a mathematical calculation (ex. addition) on the columns between rows?

Cheers,
Eric​

NazaretMartine1
Level 3
@ewilson @John Carter

More or less...

​I explain the context, because i have not explained myself well.

My process works with financial data, I have a collection A with several financial data, one of these columns is numerical (positive and negative numbers). I need to find among those numbers that rows add up to a specific value or a interval and return a collection B  with the rows that comply it.

For example, i need the rows that numeric value add up to 0.

Row 1: 140,50
Row 2: 1504,60
Row 3: - 67,60
Row 4: - 110
Row 5: - 33,50
Row 6:   3

In this example, the collection B return the row 1,4, 5 and 6 because i need a value 0.


when I asked about the combinations, it was to test the sum of this value among all the available combinations


Thank you.