Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Support Case Portal has moved to Qlik Community! Read the FAQs to start exploring Support resources.
cancel
Showing results for 
Search instead for 
Did you mean: 
lejours88
Creator
Creator

Compare Data in Load Script

Hi I have a question,

I have a folder contain qvd for each data per month, for illustration is like this:

Data_201501.qvd

Data_201502.qvd

Data_201505.qvd

From the example above, we can see that there is two deleted qvd (Data_201503.qvd , Data_201504.qvd). My goal is to reload and recover the deleted qvd.

I have find the way to get the deleted qvd by compare it with the calendar table and put the missing YearMonth into variable, let's say the varible name is FileLoad. Varible FileLoad has a data like this 201503, 201504

At last I want to load the deleted qvd from the data source and store it into qvd, the problem is how can i load only the 201503 and 201504 value.

I've try using WILDMATCH like this:

Load *

from datasource where wildmatch(YearMonth, $(FileLoad))

But the performance is too bad and really slow. The question is are there another method to load script and compare with variable without using WILDMATCH function ?

Really need your help,

Thanks in advance

1 Solution

Accepted Solutions
tamilarasu
Champion
Champion

Try like this,

Set FileLoad = '201503,201504';

FOR Each File IN $(FileLoad)

MyData:

Load *

From Datasource Where YearMonth = '$(File)';

Store MyData into [Data_$(File).qvd (qvd)];

Next File

View solution in original post

4 Replies
tamilarasu
Champion
Champion

Hi Lejours,

Set FileLoad = '201503,201504';

For Each File IN $(FileLoad)

MyData:

Load *

from Data_$(File).qvd(qvd);

NEXT File

Store Data Into ;

lejours88
Creator
Creator
Author

Hi,

Thanks for suggestion. FYI, I load the data from the DataSource not from the existing QVD.

Load *

from datasource where wildmatch(YearMonth, $(FileLoad))

i want to get again the deleted data from the datasource. QVD for Data_201503 and Data_201504 already deleted.

tamilarasu
Champion
Champion

Try like this,

Set FileLoad = '201503,201504';

FOR Each File IN $(FileLoad)

MyData:

Load *

From Datasource Where YearMonth = '$(File)';

Store MyData into [Data_$(File).qvd (qvd)];

Next File

View solution in original post

lejours88
Creator
Creator
Author

Hi thanks for idea.

Hope it will be faster than using wildmatch,

Thanks in advance