Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
How to create QVD files, Different ways to create a QVD
SRS
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
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.
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);
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;
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.
Thanks for this useful piece of code Neetha.
Hi,
Use like this in the script
TableName:
load * from
D1;
store TableName into TableName.qvd;
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.
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')
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