Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
pgalvezt
Specialist
Specialist

QVD Takes all periods

Hi. I've tried to separate my multibases by QVD Period. Im connecting by from ODBC to Many bases: The bases has the same fields

so Im using aLoad sentence Like this: The first Connection = Abr 2012, The Second Connection May 2012 and so on,

Tables:

OLEDB CONNECT TO [Provider=VFPOLEDB.1;Data Source=e:\modelos\solventa\tarjetas de credito\datos externos\bases_tc\2012\05_mayo\83 - bata;Mode=Share Deny None;Extended Properties="";User ID="";Mask Password=False;Cache Authentication=False;Encrypt Password=False;Collating Sequence=MACHINE;DSN="";DELETED=True;CODEPAGE=1252;MVCOUNT=16384;ENGINEBEHAVIOR=90;TABLEVALIDATE=3;REFRESH=5;VARCHARMAPPING=False;ANSI=True;REPROCESS=5];
LOAD *, 'Site1' as Source;
LOAD
Field1,

Field2

SQL SELECT *
FROM Table1
Where Field1 = 1;

OLEDB CONNECT TO [Provider=VFPOLEDB.1;Data Source=e:\modelos\solventa\tarjetas de credito\datos externos\bases_tc\2012\05_mayo\83 - bata;Mode=Share Deny None;Extended Properties="";User ID="";Mask Password=False;Cache Authentication=False;Encrypt Password=False;Collating Sequence=MACHINE;DSN="";DELETED=True;CODEPAGE=1252;MVCOUNT=16384;ENGINEBEHAVIOR=90;TABLEVALIDATE=3;REFRESH=5;VARCHARMAPPING=False;ANSI=True;REPROCESS=5];
LOAD *, 'Site2' as Source;
LOAD
Field1,

Field2

SQL SELECT *
FROM Table1
Where Field1 = 1;

and so on...

Store Tables Into $(PathProdQvd)Tables.qvd;

So I can save all the register in junst one single table.

Now I want to separe this tables and load singles Qvds by period:

Temp:
LOAD  Distinct Num(Year(Date(Field2,'MMM-YY'))) & Num(Month(Date(Field2,'MMM-YY')),'00') AS Load_Period
resident Tables;

LET vCount=NoOfRows('Temp');
FOR i=0 to $(vCount)
LET vCarga = Peek('Load_Period',$(i),'Temp');


V1:
NoConcatenate
LOAD *
Resident TablesWhere Num(Year(Date(Field2,'MMM-YY'))) & Num(Month(Date(Field2,'MMM-YY')),'00') = '$(vCarga)';

STORE V1 into $(PathProdQvd)V1$(vCarga).qvd;

DROP Table V1;

Next
DROP Table Temp;

I Noticed that my QVD May has ABR and MAY Together. How can I separate the months by QVDs.

My Actual QVD is V1201204 (But Show Abr and may)

Thank you

2 Replies
pgalvezt
Specialist
Specialist
Author

Any Help?

chematos
Specialist II
Specialist II

Hi,

Do you have a Datefield in your table? If you have both months in one QVD, you can do this:

ABRIL:

Load *

from V1201204

where DateField < '01/05/2012';

MAYO:

NoConcatenate

Load *

from V1201204

where DateField >= '01/05/2012';

If its only for this case with only this two months, this may work.

But there´s something I don´t understand:

Are you loading each month separetely from your database? Whay don´t you create a QVD when you get April and another with the second extraction with May data?

Regards,

Chema