Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
slaheddinekeyru
Partner - Contributor III
Partner - Contributor III

Using fields with TOTAL qualifier in RowNo()

Hello Community,

I'm using the RowNo() function when loading a table in my script.

I need the TOTAL qualifier to create a RowNo by field block. So I have to write this

test1:

LOAD

*,

RecNo(),

RowNo(TOTAL<Group>) as Rowno

Resident test

;

But it's not working.

I will be very gratefull if you have any idea.

Thank you very much for reading my discussion.

SME.

1 Solution

Accepted Solutions
sunny_talwar

May be try this

AutoNumber(RowNo(), Group) as RowNoByGroup

or this

If(Group = Previous(Group), RangeSum(Peek('RowNoByGroup'), 1), 1) as RowNoByGroup

In both cases, make sure that your data is correctly sorted (if it is not already sorted) by using a resident load with order by clause

View solution in original post

4 Replies
shraddha_g
Partner - Master III
Partner - Master III

Can you elaborate more with sample data and expected output?

sunny_talwar

May be try this

AutoNumber(RowNo(), Group) as RowNoByGroup

or this

If(Group = Previous(Group), RangeSum(Peek('RowNoByGroup'), 1), 1) as RowNoByGroup

In both cases, make sure that your data is correctly sorted (if it is not already sorted) by using a resident load with order by clause

slaheddinekeyru
Partner - Contributor III
Partner - Contributor III
Author

Thank you very much stalwar1

That's exactly what I'm looking for.

But I don't understand why we can't use the TOTAL qualifier with RowNo() ?

sunny_talwar

TOTAL qualifier is not available in the script... this is by design...