- Open the Data load editor.
- Create a new data connection called QVDFolder. This data connection should create a folder connection to the QVD folder created in Step 1.
- In the Data load editor, create a new section, Variable Setting, and add the following code to it:
LET vFileName = subfield(DocumentName(),'.',1);
SET vTable1 =1; //Product
SET vTable2 =1; //Customer
LET vQVD='QVDFolder';
- Create a new section, Data, and add the following code to it:
SUB Create_T_Product
$(vTable):
LOAD * INLINE [
Product, ProductID, Sales
Footwear, F21Lon, 120000
Tyres, T21Man, 150000
Mountain Bikes, MB32Lon, 195000
Road Bikes, RB12Bir, 225000
];
END SUB
SUB Create_T_Customer
$(vTable):
LOAD * INLINE [
Customer, ProductID, City
Hero, F21Lon, London
Avon, T21Man, Manchester
Force1, MB32Lon, London
Ferrari, RB12Bir, Birmingham
];
END SUB
- Create a new section called Store_Drop, and add the following code to it:
SUB Create_QVD_Standard(vTable,vSub)
LET vQVDStartTime = timestamp(now(),'DD MMM YY hh:mm:ss');
CALL $(vSub)
STORE '$(vTable)' INTO [lib://$(vQVD)$(vTable).qvd(qvd);
DROP TABLE $(vTable);
LET vFieldType = 'QVD_Standard';
LET vQVDEndTime = timestamp(now(),'DD MMM YY hh:mm:ss');
LET vQVDTimeTaken = Interval(vQVDEndTime - vQVDStartTime, 'hh:mm:ss');
LET vTableFullPath = DocumentPath();
TablesLoaded:
LOAD
QVDTableName('lib://$(vQVD)$(vTable).qvd') AS [STDQVD Name],
Timestamp($(vQVDStartTime),'DD MMM YY hh:mm') AS [STDQVD Start Time],
Timestamp($(vQVDEndTime),'DD MMM YY hh:mm') AS [STDQVD End Time],
Interval($(vQVDTimeTaken),'hh mm ss') AS [STDQVD Time Taken (hh mm ss)],
QVDNoOfFields('lib://$(vQVD)$(vTable).qvd') AS [STDQVD No of Fields],
QVDNoOfRecords('lib://$(vQVD)$(vTable).qvd')AS [STDQVD No of Records]
AUTOGENERATE (1);
END SUB
- Create a new section called Create qvd, and add the following code to it:
LET vRunStart = timestamp(now(),'DD MMM YYYY hh:mm:ss');
If $(vTable1) = 1 Then
CALL Create_QVD_Standard('T_Product','Create_T_Product')
ENDIF;
If $(vTable2) = 1 Then
CALL Create_QVD_Standard('T_Customer','Create_T_Customer')
ENDIF;
LET vRunFinish = timestamp(now(),'DD MMM YYYY hh:mm:ss');
LET vRunTime = Interval(num(timestamp#('$(vRunFinish)','DD MMM YY hh:mm:ss')) -num(timestamp#('$(vRunStart)','DD MMM YY hh:mm:ss')),'hh:mm:ss');
- Save and reload the document.
- On the frontend, click on Edit sheet icon at the top right-hand corner and create a new Table object by dragging it across the sheet from the left-hand side panel.
- Add all the available dimensions in the table to get the following output: