Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

adriano_fornoni
New 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

Re: Record counter for a field

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

8 Replies

Re: Record counter for a field

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

Re: Record counter for a field

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

Re: Record counter for a field

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

Re: Record counter for a field

Hi Sunny,

in the Advanced Editor..

Capture.JPG

Re: Record counter for a field

Oh okay, thank you so much

Re: Record counter for a field

No Problem :-)

adriano_fornoni
New Contributor III

Re: Record counter for a field

Thanks all

effinty2112
Honored Contributor

Re: Record counter for a field

AutoNumber(RecNo(),Gourp) as Flag


is really, really neat!

Community Browser