Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
prma7799
Master III
Master III

Count of table

Hi All,

Is there any way to find out how table we using in QVW file.

Thanks

Prashant

14 Replies
Anonymous
Not applicable

Hi,

NoOfFields([ 'TableName ' ])

Returns the number of fields in a previously loaded table.

Let vNoofFields = num(NoOfFields('TableName '));

give table name in function.

Regards

Neetha

Not applicable

Hi,

Syntax for Numbers of Fields is

Let vNoofFields = num(NoOfFields('TableName'));

For Getting NoOfFields in Each Table you have to use loop


Regards

Nandkishor


prma7799
Master III
Master III
Author

Hi Nandkishor,

Can you give some example of loop for the same.

Thanks

PM

Anonymous
Not applicable

Hi,

Try:

ODBC CONNECT TO [Excel Files;DBQ=ExcelFile.xlsx];

XlsTables:
SQLTables;
DISCONNECT;

LET vRows = NoOfRows('XlsTables');


FOR i = 0 TO $(vRows)-1

LET vSheetName = subfield(peek('TABLE_NAME', i,'XlsTables'),'$',1);
LET vFieldCount = noOfFields(TABLE_NAME);

$(vSheetName):
LOAD * ,
$(vFieldCount) as FieldCount
FROM [ExcelFile.xlsx]
(
ooxml, embedded labels, table is '$(vSheetName)');

NEXT i

DROP TABLE XlsTables;

Not applicable

Hi,

You can use below code to get No Of Field

LET vNooftable= NUM(NoOfTables());
Let vNoofFields=0;
FOR i= 1 to $(vNooftable) step 1

Let vNoofFields = vNoofFields + num(NoOfFields(TableName(i-1))) ;

NEXT

Nandkishor Pandirkar