Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to add a sequence number for every group in the straight table?

Hello everybody,

I have a table as below, I would like to add a sequence number for every group into the straight table as below, do you have any suggustion? Thanks.

LOAD * INLINE [
    Group, Member, Amount
    G1, A, 100
    G1, B, 100
    G1, C, 100
    G2, D, 100
    G2, E, 100
    G2, F, 100
    G3, G, 100
    G3, H, 100

];

GroupMemberSeqAmount
G1A1100
G1B2100
G1C3100
G2D1100
G2E2100
G3F1100
G3G2100
G3H3100
1 Solution

Accepted Solutions
Not applicable
Author

Thank you guys.

As the row number should be changed base on the current selection, as i can't set the number in the loading script.

I have soloved the issue with using aggr and rowno() as below.

aggr(

rowNo()

,group,member)

Thanks.

View solution in original post

5 Replies
selvakumarsr
Creator
Creator

Try RowNo() with Condition..

Selva

its_anandrjs

You have to try this way

LOAD *,AutoNumber(recno(), Group) as Seq;

LOAD * INLINE [

    Group, Member, Amount

    G1, A, 100

    G1, B, 100

    G1, C, 100

    G2, D, 100

    G2, E, 100

    G2, F, 100

    G3, G, 100

    G3, H, 100

];

And you get out put as

Seq.png

PradeepReddy
Specialist II
Specialist II

Add an expression,  '=rowno()' in chart

Regards

Pradeep

fkeuroglian
Partner - Master
Partner - Master

Hi,

use Autonumber() or RowNo function in the load script

Good luck

Not applicable
Author

Thank you guys.

As the row number should be changed base on the current selection, as i can't set the number in the loading script.

I have soloved the issue with using aggr and rowno() as below.

aggr(

rowNo()

,group,member)

Thanks.