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: 
Anonymous
Not applicable

loop qvd qlikview

with the following script I split a huge big table in a  small QVD per year-month

Dates:

LOAD DISTINCT

Year, Month

 

RESIDENT Calendrier;

LET vNoOfMthsYrs = NoOfRows('Dates');

FOR i = 0 TO $(vNoOfMthsYrs) - 1

LET vMth = PEEK('MONTH', $(i), 'Dates');

LET vYr = PEEK('YEAR', $(i), 'Dates');

MONTHLYSPLIT:

LOAD

* RESIDENT Vente WHERE MONTH( [Date Time]) = '$(vMth)' AND YEAR( [Date Time]) = '$(vYr)';

STORE MONTHSPLIT INTO E:\QVD\QVD\Vente_$(vMth)_$(vYr).qvd (qvd);

NEXT

   drop table MONTHLYSPLIT ,Dates;

How could I read loop successively over qvd that I ready created ?

2 Replies
sunny_talwar

jaweher89 wrote:

How could I read loop successively over qvd that I ready created ?

Not sure I understand your question.

marcus_sommer

Try:

  1. Dates:  
  2. LOAD DISTINCT  
  3. Year, Month 
  4.    
  5. RESIDENT Calendrier; 
  6.  
  7. LET vNoOfMthsYrs = NoOfRows('Dates');  
  8.  
  9.  
  10. FOR i = 0 TO $(vNoOfMthsYrs) - 1  
  11.  
  12.  
  13. LET vMth = PEEK('MONTH', $(i), 'Dates');  
  14. LET vYr = PEEK('YEAR', $(i), 'Dates');  
  15. if filesize('E:\QVD\QVD\Vente_$(vMth)_$(vYr).qvd') > 0 then
  16. trace QVD exists already;
  17. else
  18. MONTHLYSPLIT:  
  19. LOAD  
  20.  
  21.  
  22. * RESIDENT Vente WHERE MONTH( [Date Time]) = '$(vMth)' AND YEAR( [Date Time]) = '$(vYr)';  
  23.  
  24. STORE MONTHSPLIT INTO E:\QVD\QVD\Vente_$(vMth)_$(vYr).qvd (qvd);  
  25.   end if
  26. NEXT  
  27.  
  28.    drop table MONTHLYSPLIT ,Dates;

- Marcus