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

add a value to NEXT row

Hi All,

I have a field that has a the value 1 everytime a condition is met. I want to in another field(one we will be creating) add a condition that says if the value in field1 = 1 then in the next recno() put a 1. How the hell do I do this

Cheers,

Byron

1 Solution

Accepted Solutions
nagaiank
Valued Contributor III

Re: add a value to NEXT row

I used the following script and it seemed to work for me.

Data:

LOAD IterNo() as ID, Round(Rand()) as Field1 AutoGenerate 1 While IterNo() <= 10;

Left Join (Data) LOAD ID, Field1, If(Peek(Field1)=1,1,0) as Field2 Resident Data;

New Bitmap Image.bmp

Is this what you wanted to do?

4 Replies
nagaiank
Valued Contributor III

Re: add a value to NEXT row

You may try something like this:

LOAD ...,

     If(Peek('field1')=1,1) as another-field,

     ...

Not applicable

add a value to NEXT row

Have tried that before, doesnt work. No matter my order by nothing, sadly ): I've concluded that i need to somehow use recno() next... to insert my value. Want to know if anyone has managed to do this?

Thanks,

byron

nagaiank
Valued Contributor III

Re: add a value to NEXT row

I used the following script and it seemed to work for me.

Data:

LOAD IterNo() as ID, Round(Rand()) as Field1 AutoGenerate 1 While IterNo() <= 10;

Left Join (Data) LOAD ID, Field1, If(Peek(Field1)=1,1,0) as Field2 Resident Data;

New Bitmap Image.bmp

Is this what you wanted to do?

Not applicable

add a value to NEXT row

It is, thank you very much

Community Browser