Sectioning off data based on a few values in one column

I had a quick question on how to partition/section off data every month that I am receiving based on a number generated in a column that has other information as well.

For example.

Store ID Date Amount
1 Beg 50
15 10-Jul-19 10
20 10-Jul-19 20
30 10-Jul-19 10
End 90
2 Beg 30
10 10-Jul-19 10
15 10-Jul-19 20
End 60
3 Beg 20
10 10-Jul-19 10
20 10-Jul-19 20
40 10-Jul-19 10
60 10-Jul-19 -50
End 10
4 Beg 10
20 10-Jul-19 10
30 10-Jul-19 20
End 40

Formatted, it would look like

And the result I would like is

Store ID Date Amount
1 Beg 50
15 10-Jul-19 10
20 10-Jul-19 20
30 10-Jul-19 10
End 90
Store ID Date Amount
2 Beg 30
10 10-Jul-19 10
15 10-Jul-19 20
End 60
Store ID Date Amount
3 Beg 20
10 10-Jul-19 10
20 10-Jul-19 20
40 10-Jul-19 10
60 10-Jul-19 -50
End 10
Store ID Date Amount
4 Beg 10
20 10-Jul-19 10
30 10-Jul-19 20
End 40

Ideally like below:

With each store ID in it’s own output with an excel sheet appender. I understand I can manually partition each data every month. But that defeats the purpose of the automatic workflow.

Hi @Aliciang78

I created this sectioning_of_data.knwf (69.8 KB). First it identifies the rows that needs to be grouped together. After that a group loop used to partitioning the data and write every section to a separate xls tab. Hope this helps.

gr
Hans

3 Likes

Thanks a bunch! Definitely wouldn’t have thought of the counter generation on my own and joining it back together with the original data set.

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.