Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
adriano_fornoni
Contributor III
Contributor III

Record counter for a field

Hi all,

I have to build a script to create a table like this:

GourpDetailFlag (to create)
1051
1042
1033
1181
1172
1153
12101
1232

The table key is the fields union Group and Detail, the Flag field is the one I have to generate.

For each Group different value must have the Flag field is renewed and assumes a progressive function of the Detail field.

Can you tell me at least one function that can help me?

Bye and thanks

1 Solution

Accepted Solutions
settu_periasamy
Master III
Master III

One More approach..

Load *,AutoNumber(RecNo(),Gourp) as Flag;

LOAD Gourp,

     Detail

FROM

[https://community.qlik.com/thread/192818]

(html, codepage is 1252, embedded labels, table is @1);

Capture.JPG

View solution in original post

8 Replies
sunny_talwar

This?

Table:

LOAD *,

  If(Gourp = Previous(Gourp), RangeSum(Peek('Flag'), 1), 1) as Flag;

LOAD Gourp,

    Detail

FROM

[https://community.qlik.com/thread/192818]

(html, codepage is 1252, embedded labels, table is @1);


Capture.PNG

settu_periasamy
Master III
Master III

One More approach..

Load *,AutoNumber(RecNo(),Gourp) as Flag;

LOAD Gourp,

     Detail

FROM

[https://community.qlik.com/thread/192818]

(html, codepage is 1252, embedded labels, table is @1);

Capture.JPG

sunny_talwar

Hey Settu

Would you be able to guide me on how can I share script like this?

Capture.PNG

I have tried to do this before, but not really sure how this format can be applied while pasting a script.

Thanks,

Sunny

settu_periasamy
Master III
Master III

Hi Sunny,

in the Advanced Editor..

Capture.JPG

sunny_talwar

Oh okay, thank you so much

settu_periasamy
Master III
Master III

No Problem 🙂

adriano_fornoni
Contributor III
Contributor III
Author

Thanks all

effinty2112
Master
Master

AutoNumber(RecNo(),Gourp) as Flag


is really, really neat!