I have a data set with two fields in which I need to create a dense rank for. When Field_1 is not null then Field_2 is null and vice-versa.
Field_1 Field_2
a
1
2
3
4
b
7
8
9
c
15
20
25
Im trying to get to this
Field_1 Field_2 Field_3
a 1
1 1
2 1
3 1
4 1
b 2
7 2
8 2
9 2
c 3
15 3
20 3
25 3
I can order the data wit the following line:
row_number() over (partition by null order by Field_2,Field_1) as Field_3
but this does not give me the dense rank I am looking for.