Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikview979
Specialist
Specialist

Recent qvd

Hi Experts,

please find the my  attached  source files.

I have  source1 folder Three Qvds  names like

2016_01_01.qvd

2016_01_02.qvd

2016_01_03.qvd

qvd creation time is 11:10:10 AM

and

source2 folder Three Qvds names like

2016_01_01.qvd

2016_01_04.qvd

2016_01_05.qvd

Qvd creation time is 11:15:15 AM

then i have loaded all qvd's into qlikview .Check here  2016_01_01.qvd name having 2 qvd's  ..

coming to my requirement

i need latest with same  name 2016_01_01.qvd  from source2

Output:  i want 2016_01_01.qvd   from source2 because this is the latest qvd based on timestamp.

45 Replies
qlikview979
Specialist
Specialist
Author

Hi Tim Driller,

Please find my attached Qvw and Qvd's.

Here i have Attached Qvd's  from  source1& source2

Source1 QVd's names like 

2016_04_21.qvd

2016_04_22.qvd

2016_04_23.qvd


and


Source2 QVd's names like 

2016_04_21.qvd

2016_04_27.qvd

2016_04_28.qvd    


one Qvd having same name 2016_04_21.qvd but reload time is different. i want in   common qvd  (2016_04_21.qvd)   which qvd  having


latest reload. we need that one only.as  my Knowledge  common qvd (2016_04_21.qvd) having latest reload from source2.


Note: I want only one(single) 2016_04_21.qvd from Source2. Because that is the latest one.



Kushal_Chawda

I am getting the 201527.qvd from source2 only. Have you checked my QVW?. There I have two table box

qlikview979
Specialist
Specialist
Author

Hi Kushal,

Thanks for your support.

i got the output. i have used this code

for each Vpeek in FileList('H:\Personal\LATEST QVD\source1\*.xlsx');

let VRep=Replace(Vpeek,'.xlsx','.qvd');

T1:

LOAD*

FROM

[$(Vpeek)]

(ooxml, embedded labels, table is Sheet1);

STORE T1 into $(VRep);

drop table T1;

next

for each Vpeek1 in FileList('H:\Personal\LATEST QVD\source2\*.xlsx');

let VRep1=Replace(Vpeek1,'.xlsx','.qvd');

T4:

LOAD *

FROM

[$(Vpeek1)]

(ooxml, embedded labels, table is Sheet1);

STORE T4 into $(VRep1);

drop table T4;

next

LET vSource1Path ='H:\Personal\LATEST QVD\source1\';

LET vSource2Path ='H:\Personal\LATEST QVD\source2\';

LET vStorePath ='H:\Personal\LATEST QVD\';

For each vFile1 in Filelist ('$(vSource1Path)*.qvd')

Files1:

LOAD SubField('$(vFile1)','\',-1) as FileName,

    '$(vFile1)' as FileName1,

    filetime('$(vFile1)') as FileTime1

autogenerate 1;

Next vFile1

For each vFile2 in Filelist ('$(vSource2Path)*.qvd')

Files2:

LOAD SubField('$(vFile2)','\',-1) as FileName,

    '$(vFile2)' as FileName2,

    filetime('$(vFile2)') as FileTime2

autogenerate 1;

Next vFile2

New:

noconcatenate

LOAD *

Resident Files1;

inner join(New)

LOAD *

Resident Files2;

Drop Tables Files1, Files2;

FileName:

LOAD *

Where not IsNull(FileName);

LOAD

if(FileTime2 > FileTime1,FileName2,FileName1) as FileName,

timestamp(Rangemax(FileTime2,FileTime1)) as FileTime

Resident New;

DROP Table New;

AllQVD:

LOAD 1 as Junk

Autogenerate 1;

For i=1 to FieldValueCount('FileName')

let vFileName = FieldValue('FileName',$(i));

Concatenate(AllQVD)

LOAD *,

    '$(vFileName)' as FileName

FROM $(vFileName)(Qvd);

Next i

drop field Junk;

Store AllQVD into $(vStorePath) FinalQVD.qvd;

Regards,

Mahesh.

Kushal_Chawda

I am glad that you were able to get the solution. Please mark the correct or helpful answers so that others can also use this for the same problem

Kushal_Chawda

Wasn't my reply helpful?

qlikview979
Specialist
Specialist
Author

Hi Kushal,

Your script is Helpful. but slight changes are there.

Rgards,

Mahesh