2 Replies Latest reply: Feb 10, 2014 10:27 AM by Evandro Segura RSS

    Open QVD or QVW file in R-Project

      How can i open a qvd or qvw file from r-project to work on data mining?

        • Re: Open QVD or QVW file in R-Project





          • Re: Open QVD or QVW file in R-Project
            Evandro Segura

            Hi Handry,


            Here's an example:


            • [MeuProjeto2.qvw] need to extract information from a table contained in [MeuProjeto1.qvw]:


            • In [MeuProjeto2.qvw], the first line of the script, must be Binary statement:


            Binary [C:\MeuProjeto1.qvw];


            Next, make a loop to catalog the tables in qvw to serve as a data source


            For i = 0 to NoOfTables()-1

              Let vTableName = chr(39) & TableName($(i)) & Chr(39);


              Load $(vTableName) as TableName

              AutoGenerate 1;



            • Following, make a loop to extract the desired information storing them in QVD files.


            For i = 0 to (NoOfRows('Tables')-1)

              LET vTable = '[' & Peek('TableName', $(i), 'Tables') & ']';

              LET vQVDName = Peek('TableName', $(i), 'Tables');


              // Tabela interesse: [SessionTaskAuditMaster]

              IF vTable = '[NomeTabelaDesejada]' THEN

                    Store $(vTable) into $(vQVDName).QVD;

              END IF;

              Drop Table $(vTable);



            Drop Table Tables;


            • From there, with the QVD file layout, usually make the extraction as:





            LOAD Field1 AS SalesDate,

               Field2 AS SalesMan,

                Field3 AS SalesAmount

            FROM NomeTabelaDesejada.QVD(qvd);


            Works perfectly! Hope this helps!