Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
marcel_olmo
Partner Ambassador
Partner Ambassador

Divide a Qvd into smaller Qvds by Row Number

Hi guys,

I have a Qvd like this which has several millions of rows:

MyTable :

LOAD
TextField1,
TextField2,

....

FROM [lib://MyTable.qvd]
(qvd);

And I'd like to divide it into smaller Qvds by row Number, to get QVds of maximum 1 million of rows.

I'm trying to do it applying a where clause with a Rowno() function with minimum and maximum values, but it's not working.

Anybody has a clue about how to do this?

Best regards, Marcel.

 

Labels (1)
1 Solution

Accepted Solutions
Taoufiq_Zarra

@marcel_olmo 

Maye be :

 

Data:
LOAD  DIV(rowno(),1000000) as IndexQvd,
	  Field1, 
     Field2
FROM
.\MyTable.qvd
(qvd);

ValueList:
load distinct IndexQvd as Valuelist resident Data;


NumRows=NoOfRows('ValueList');
FOR i=0 to $(NumRows)-1
  LET vBox=Peek('Valuelist',$(i));
  
	 Data$(i):
	 noconcatenate
 	  LOAD * resident Data where IndexQvd='$(i)';
	 
	  store Data$(i) into Data$(i).qvd (qvd);
	  drop table Data$(i);

NEXT

drop table Data,ValueList;

 

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉

View solution in original post

2 Replies
Taoufiq_Zarra

@marcel_olmo 

Maye be :

 

Data:
LOAD  DIV(rowno(),1000000) as IndexQvd,
	  Field1, 
     Field2
FROM
.\MyTable.qvd
(qvd);

ValueList:
load distinct IndexQvd as Valuelist resident Data;


NumRows=NoOfRows('ValueList');
FOR i=0 to $(NumRows)-1
  LET vBox=Peek('Valuelist',$(i));
  
	 Data$(i):
	 noconcatenate
 	  LOAD * resident Data where IndexQvd='$(i)';
	 
	  store Data$(i) into Data$(i).qvd (qvd);
	  drop table Data$(i);

NEXT

drop table Data,ValueList;

 

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
marcel_olmo
Partner Ambassador
Partner Ambassador
Author

Thank you @Taoufiq_Zarra !