Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

QVD Creation

Hi All,

How to create QVD files, Different ways to create a QVD

SRS

29 Replies
its_anandrjs

Hi,

No there is not any effect if you put drop statement after the store statement and noconcatenate command is used to not concatenate to tables like if there is any tables name is same and fileds name is also same so in qlikview is automatically concatenate to the previous table noconcatenate is forcelly used to not concatenate to the table previous table.

Regards,

Anand

2908nmadao
Contributor III
Contributor III

Hi all!

This is the error that is not allowing me to store the tables into QVDs:

Cannot open file 'C:\Users\X\Desktop\Qlikview Test \Test.dbo."vw_Cha"' The system cannot find the file specified.

Cha:
load * from
Test.dbo."vw_Cha"

Anyone can help ?

Thanks in advance for your help!

N.

rajkumarb
Creator II
Creator II

Hi Nelson

THIS  STORES ALL THE TABLES LOADED INTO QVDS

//Loop through all of the table names and store them to QVD.

LET vTableVol = NoOfTables();//Get the number of tables loaded

FOR i = 0 TO $(vTableVol) - 1 ;

LET vTableNameS = TableName($(i));


IF '$(vTableNameS)' <> 'Vars' AND '$(vTableNameS)' <> 'Tables' AND '$(vTableNameS)' <> 'DBInfo' THEN //Do not load the system tables in the main QVD folder

STORE $(vTableNameS) INTO  $(vQVDFilePath)$(vTableNameS).qvd (qvd);

ELSE

STORE $(vTableNameS) INTO  $(vQVExSysPath)$(vTableNameS).qvd (qvd);

Anonymous
Not applicable
Author

Hi,

Check below:

TempTable:
LOAD Distinct Year([Accounting Period]) AS YearField
FROM QVD\Main.qvd(qvd)
Order by Year([Accounting Period]) asc;

NoConcatenate

Table:
Load YearField,Min(YearField) as minYear, max(YearField) as maxYear
Resident TempTable;

Let vMin=Peek('minYear', 0, 'Table');
Let vMax=Peek('maxYear', 0, 'Table');

FOR i=$(vMin) to $(vMax)
LET vYear = Peek(' YearField ',$(i),'TempTable');

ConsolidateYearWise:
Concatenate
LOAD * ,
Year([Accounting Period]) AS YearFlag
FROM QVD\Main.qvd(qvd)
Where Year([Accounting Period]) = '$(vYear)';

Next

STORE ConsolidateYearWise into ConsolidateData.qvd;

DROP Table ConsolidateYearWise;

DROP Table TempTable;
DROP Table Table;


//Yearly QVD:

TempTable:
LOAD Distinct Year([Accounting Period]) AS YearField
FROM QVD\Main.qvd(qvd)
Order by Year([Accounting Period]) asc;

NoConcatenate

Table:
Load YearField,Min(YearField) as minYear, max(YearField) as maxYear
Resident TempTable;

Let vMin=Peek('minYear', 0, 'Table');
Let vMax=Peek('maxYear', 0, 'Table');

FOR i=$(vMin) to $(vMax)
LET vYear = Peek(' YearField ',$(i),'TempTable');

SeparateYearWise:
NoConcatenate
LOAD * FROM QVD\Main.qvd(qvd)
Where Year([Accounting Period]) = '$(vYear)';

STORE SeparateYearWise into TableName_$(vYear).qvd;
DROP Table SeparateYearWise;

Next

DROP Table TempTable;
DROP Table Table;


//Past 6 months QVD:

LET vAccountingPeriod = num(addmonths(today(),-6));

SixMonthsData:
LOAD * FROM QVD\Main.qvd(qvd)
Where [Accounting Period]>=$(vAccountingPeriod);

STORE SixMonthsData into TableName_SixMonthsData.qvd;
DROP Table SixMonthsData;

2908nmadao
Contributor III
Contributor III

Hi Raj!! Thanks a lot for your quick reply!

I have reloaded my script with this piece of code and it stored the tables as variables but did not create a separate .QVD file. Would you be so kind to explain me how you could do that ?

Thanks.

2908nmadao
Contributor III
Contributor III

Thanks for this useful piece of code Neetha.

Anonymous
Not applicable
Author

Hi,

Use like this in the script

TableName:

load * from

D1;

store TableName into TableName.qvd;

2908nmadao
Contributor III
Contributor III

Could you also be so kind and help me with the following?

I would like to convert all date fields across my application from DD/MM/YYYY HH:MM:SS to DD/MM/YYYYMy question is, can I make it directly in my initial script rather than in an object expression, so that I will not have to amend it each time I insert a new object?

Thanks for your time!

Kind regards,

Nelson.


Anonymous
Not applicable
Author

Hi,

If u don't need the timing part of a date you can take directly in the script

Sytax is like this

Date(DateFiledName,'DD/MM/YYYY')

Anonymous
Not applicable
Author

Hi Nelson,

Please Start new thread for new Questions.

Try below code in script:

Date(Date#(DateFiledName,'DD/MM/YYYY HH:MM:SS'),'DD/MM/YYYY') as Date

Regards

Neetha