Select N first data points per item from a larger data set

Hi,

I have a list of accounts with balance data (monthly, 24 months). The format is like this:

Headers: Account number, MonthYear, Balance.
Values: actual account number, specific month, like 022017, then the balance in EUR for this month.

For some accounts I have just few months of data because these accounts are new. For other accounts, I have full 24 months of data.

Which nodes should I use to get for each account only its own first 6 months of data?

I.e. something like this:

Headers: Account_number, Month_one, Month_two, …, Month_ six
Values: actual account number, and then the relevant balance for each month

It looks a bit like pivoting, but then how to select just first six months for each account knowing that for some accounts it will be January - June, for others February-July etc?

Thank you!

Ola

Use a Group Loop Start node, setting the group to be the account number. Each loop iteration will then contain only the subset of the table for a single account number. Then use a Row Filter node to select the 1st 6 rows (I am assuming 1 row per month?), then a standard Loop End node to complete the loop

Steve

1 Like