4 Replies Latest reply: Sep 18, 2013 12:20 PM by Gysbert Wassenaar

# SPLIT RECORDS IN SETS HAVING THE SAME sum(Value)

Hi all,

Let's assume I have a table  with a simple structure:

RecordIDValue
110
220
325
415
5100
......
n1000

I would like to ORDER the records by Value (ascending) and then SPLIT the records in 10 sets, each set HAVING THE SAME sum(Value) - that is sum(TOTAL Value)/10.

The end result would be a chart showing all those 10 sets and the number of records contained in each set. Something like this:

Records Set#Records
Set150
Set230
Set315
......
Set102

Could anyone please suggest a solution for this?

Thanks,
Carmen

• ###### Re: SPLIT RECORDS IN SETS HAVING THE SAME sum(Value)

Hi Carmen,

I am not understanding how you want to split in 10 sets.

I am thinking that you would first

Then flag similar record to create your 10 theoretical subsets.

Kind regards,

Antoine

• ###### Re: SPLIT RECORDS IN SETS HAVING THE SAME sum(Value)

I think you can use the Aggr(rank(Expression),RecordId) function  and use the rank as dimension with a count of RecordID...

• ###### Re: SPLIT RECORDS IN SETS HAVING THE SAME sum(Value)

Hope the attachment might helps.

I have used inline load. You can generate this using rowno or recno.

• ###### Re: SPLIT RECORDS IN SETS HAVING THE SAME sum(Value)

See attached example.