Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
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
Specialist III
Specialist III

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?

View solution in original post

4 Replies
nagaiank
Specialist III
Specialist III

You may try something like this:

LOAD ...,

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

     ...

Not applicable
Author

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
Specialist III
Specialist III

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
Author

It is, thank you very much