

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Do while iterno() issue
Hi All,
I have a requirement where I have 10 user IDs, each having more than 400 text, I would like to load only 2000 records into 5 QVDs for first 5 user IDs, like 400 for each user and stop there. But the problem is the code was not stopping at 2000 records (5 users) and loading 400 records for each remaining 5 users, creating 10 QVDs and still running. Please let me know how I can resolve this?

.png)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Instead of IterNo() you can vLoopNumber variable like below, Iterno() works only in Load statement
LET vLoopNumber = 1;
Do while vLoopNumber < 2000
Let vLoopVariable = peek('LoopVariable',vLoopNumber-1,'LoopVariables');
Twitter_Table:
First 400 LOAD
id as UserTimelineid,
created_at as UserTimelinecreated_at,
text as UserTimelinetext,
source as UserTimelinesource
FROM
(qvx);
STORE Twitter_Table into 'QVDs\QVD_$(vLoopVariable).qvd';
DROP Table Twitter_Table;
vLoopNumber = vLoopNumber+1;
LOOP
Regards,
Jagan.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Jagan,
Thanks for the reply.
Sorry it didn't worked. Your code is working the same way as my original code.
Is there any other way to resolve this issue?
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
try by changing the do while condition
"Do while IterNo() < 2000" to 'Do while IterNo() <=5'
Edit:
If I understand correctly, you want to retrieve the first 400 tweets by the user and store them in the QVD. If so, you required 5 iterations only.

.png)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
HI,
Instead of do while use while
LET vLoopNumber = 1;
DO while vLoopNumber < 2000
Let vLoopVariable = peek('LoopVariable',vLoopNumber-1,'LoopVariables');
Twitter_Table:
First 400 LOAD
id as UserTimelineid,
created_at as UserTimelinecreated_at,
text as UserTimelinetext,
source as UserTimelinesource
FROM
(qvx);
STORE Twitter_Table into 'QVDs\QVD_$(vLoopVariable).qvd';
DROP Table Twitter_Table;
LET vLoopNumber = vLoopNumber+1;
LOOP
This should work, if not try debugging where you are getting issue.
Regards,
Jagan.
