Here's an example:
K: the key that can be based on one or more fields
D: some data
S: data indicator for switching the key context
G: a grouping based on the key and "seeing" the switch
I may have the following dataset:
Code: Select all
K1 D1
K1 D2
K1 S
K1 D3
K1 D4
K1 D5
K1 S
K2 D1
K2 S
K2 D2
K2 D3
K2 S
I might want to create a running counter or group them together by creating
the latter two fields:
Code: Select all
K1 D1 1 G1
K1 D2 2 G1
K1 S 3 G1
K1 D3 1 G2
K1 D4 2 G2
K1 D5 3 G2
K1 S 4 G2
...