cancel
Showing results for 
Search instead for 
Did you mean: 

Rank function in SAP BODS

Former Member
0 Kudos

How do we implement the following logic in BODS for column fields:(say Line_num)

For every unique combination of other key fields (SERVID, PRODID, BILL_ACCT,) this has to incremented by 1. E.g. the first record will 1 and second 2 , so on so forth

.

Can we use the following syntax in the Query transform:

gen_row_num_by_group(SERVICID,PRODID,BILL_ACCT) and this should be given in the query

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Is there any way of sorting the data. It's a source file

The combination of the 3 columns service Id , ban and prod Id are unique.

So we have column Line num where the values are incremented by one if the same combination is repeated

Example

A B C 1

A B C 2

So how can I achieve this in BOds?

Former Member
0 Kudos

Is there any way of sorting the data. It's a source file

The combination of the 3 columns service Id , ban and prod Id are unique.

So we have column Line num where the values are incremented by one if the same combination is repeated

Example

A B C 1

A B C 2

So how can I achieve this in BOds?

former_member198401
Active Contributor
0 Kudos

Harini,

As Dirk mentioned, you can sort the input data coming from Flat file in the Query Transform>Advanced options and then in the next query transform apply the gen_row_num_by_group(SERVICID,PRODID,BILL_ACCT) function for the mapping of LINE_NUM column

Regards

Arun Sasi

former_member187605
Active Contributor
0 Kudos

Yes.

Make sure that your data is sorted on SERVICID, PRODID and BILL_ACCT before processing it in the Query transform!