Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

Generate Sequence

Hello!

Help me please ...

I have the following table and need to create a new column with a numeric sequence according to the amount of photos of each product.

tab1.jpg

I wish the results were as shown below:

tab2.jpg

Tags (2)
1 Solution

Accepted Solutions
luciancotea
Valued Contributor

Re: Generate Sequence

LOAD idProduct,

          urlPhoto,

           if( peek(idProduct) = idProduct, peek(Sequence)+1, 1) as Sequence

RESIDENT photos;

3 Replies
luciancotea
Valued Contributor

Re: Generate Sequence

LOAD idProduct,

          urlPhoto,

           if( peek(idProduct) = idProduct, peek(Sequence)+1, 1) as Sequence

RESIDENT photos;

Not applicable

Re: Generate Sequence

Thank you!

Re: Generate Sequence

I think much easier is

autonumber(Recno(), idNumber) as Sequence

-Rob

Community Browser