Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
vardhancse
Specialist III
Specialist III

How to get the count of records in QVD

Hi,

Was trying to validate the records count from source->DB->QV(QVD)

creating one dashboard, which shows count of records table wise from source->DB->QVD

Can any one please let me know how to get the count of records in the QVD(Incremental load).

6 Replies
Not applicable

You can simply use the function QvdNoofRows() for this.

From the QV-reference manual:

QvdNoOfRecords(filename)

Returns the number of records currently in a QVD file.

The filename is the name of a QVD file, if necessary including path.

Examples:

QvdNoOfRecords ('MyFile.qvd')

QvdNoOfRecords ('C:\MyDir\MyFile.qvd')

So you can compare this number with the select count(*) FROM yourTable;

vardhancse
Specialist III
Specialist III
Author

Thanks but I am trying to export the count to an excel format not in the QVW.

senpradip007
Specialist III
Specialist III

First Load your QVD(Incremental load). Then you can try with NoOfRows('TableName') or QvdNoOfRecords(filename) function.

Eg:

Tab:

Load *

From <Data Source>;

LET a = NoOfRows('Tab');

its_anandrjs

You can create a variable in the load script for get the no of records by using NoofRows() or   QvdNoOfRecords ( ) like

Let vQVDRecords = QvdNoOfRecords ('C:\MyDir\MyFile.qvd');

Or

Let vNOOrRecords = NoofRows ('TableName');

its_anandrjs

Update the script now check

Then try like

TableName:

Load

*

From QVD;

Let vQVDRecords = QvdNoOfRecords ('C:\MyDir\MyFile.qvd'); //It reads from the QVD rows


Let vNoOfRows = NoofRows ('TableName'); //It reads from the table loads

TableRows:

Load * inline

[

QVDRows,TableRows

'$(vNoOfRows)','$(vQVDRecords)'

];

Store TableRows into TableRows.qvd(qvd); //But if you want to create the xls file change syntax but the file not created in xls format it is in txt file and after opening save it as xls file

Store TableRows into TableRows.xls(txt);

Not applicable

Please find attached an example .qvw where I show how it works.

- First I load some data to generate a .qvd (this is to simulate the .qvd you already have).

- then I trace the no of rows so you see it while reloading and in the logging (if activated)

- then this #rows is loaded inline

- then this is stored to a csv file

This could be extended to multiple .qvd's if needed.

Hope it helps.