Subscribe Bookmark RSS Feed

Sequence Field repeated based on FIRST.

How could I create a sequence that restarts when it gets to a new level of another field.

What I want is something like this. How can I calculate the SNO field?

VAR1 VAR2 SNO

A A 1
A A 2
A A 3
A B 1
A B 2
B A 1
B A 2
B A 3
B A 4
B B 1
B B 2
B B 3
2 REPLIES
mpb

Super User

Joined:

Jun 23, 2011

Try using this script as a formula for the SNO column:


If( Row() == 1,

    1,

    If( :VAR1 == :VAR1[Row() - 1] &
:VAR2 == :VAR2[Row() - 1],

       
:SNO[Row() - 1] + 1,

        1

    )

)
Thanks!