Skip to Content
avatar image
Former Member

Rank function in SAP BODS

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Jun 30, 2017 at 09:28 AM

    Yes.

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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 01, 2017 at 10:19 AM

    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?

    Add comment
    10|10000 characters needed characters exceeded

    • 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

  • avatar image
    Former Member
    Jul 01, 2017 at 10:19 AM

    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?

    Add comment
    10|10000 characters needed characters exceeded