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: 
gayatri7
Creator II
Creator II

Issue with For loop for creating QVDs based on different countries

Hi All,

I have multiple QVDs based on different countries created from raw data with below record counts.

Opco No.of Records
Poland 8952
Kenya 389
Greece 2461

 

Issue is while doing few transformation and storing back the result again to store in another QVDs per country, Record counts are getting accumulated.

Opco No.of Records  
Poland 8952  
Kenya 9341 Ken+Pol
Greece 11802 Grc+Ken+Pol

 

as you can see from above result, first qvd for Poland is storing the correct number of records but from 2nd onwards i.e. Kenya --> adding the records from Pol + Ken

3. Greece QVD --> adding the records from Pol+Ken+Greece  and so on

Below is my for loop code

For i=0 to NoOfRows('Opco_List')-1

Let opco = Peek('OPCO',$(i),'Opco_List');

RECEPTION:
LOAD *
FROM
[$(EXTRACTION_PATH)RM_$(opco).qvd]
(qvd);
TRACE "storing the Reception Data";
Store RECEPTION into $(DESTINATION_PATH)RECEPTIONS/RMX_LDS_BCMIX_FTP_$(opco).qvd(qvd);
NEXT i

also 'Opco_List' is inline table having below details.

POL

KEN

GRC

Could you please let me know what is happening here?

P.S. I checked the log as well and it is picking the correct QVD based on country while loading and storing the data. Not able to figure it out why it is accumulating the records from previous country QVD.

 

Any help will be appreciated.

Thanks

Gayatri

Labels (2)
1 Solution

Accepted Solutions
maxgro
MVP
MVP

I think you should drop the RECEPTION table after the store and before NEXT.

View solution in original post

2 Replies
maxgro
MVP
MVP

I think you should drop the RECEPTION table after the store and before NEXT.

gayatri7
Creator II
Creator II
Author

Thanks. It worked!!