Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
dmpilars
Partner - Creator
Partner - Creator

Generate counter by groups

Hi People!

Please Help me, I try to make a consecutive number like this:

COD               NIT             Consecutive

00000          123456          000001

00000          123456          000001

00000          123456          000001

00000          123456          000001

00000          234567          000002

00000          234567          000002

00000          234567          000002

00000          234567          000002

00009          345678          000003

00009          345678          000003

00010          345678          000003

00010          345678          000003

00011          345678          000003


I need to assign the consecutive number and this depends on NIT and COD value.

12 Replies
sunny_talwar

May be like this

AutoNumber(NIT&COD1, Left(NIT&COD1, 7)) as CONSEC

sunny_talwar

Check this script

Table:

LOAD RowNo() as RowNum,

*,

Num(AutoNumber([NIT&COD1], Left([NIT&COD1], 7)), '000000') as CONSEC;

LOAD * INLINE [

    NIT&COD1

    500096929000000

    500096929000000

    500096929000000

    500096929000001

    500096929000001

    500096929000001

    500096929000002

    500096929000002

    500096929000002

    500096929000009

    500096929000009

    500096929000009

    500122959000955

    500122959000955

    500122959000955

    500129157000959

    500129157000959

    500129157000959

    500129157000960

    500129157000960

    500129157000960

    500150250000012

    500150250000012

    500150250000012

];

Capture.PNG

dmpilars
Partner - Creator
Partner - Creator
Author

Hi Sunny, thanks for your time and your answer! this Works... can you explain me a Little bit better the expression that you use? I'm very new in qlik sense and I still have a hard time understanding expressions