Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Dynamic count of fields for inline data


Hi,

  I have 20  table names.  I want to show in a  table

example:

Tablenamesno of fieldssno
a451

                       

I gave  table names  using inline ..

how do i count  table . and how to match exactly.

Thanks

9 Replies
Anonymous
Not applicable
Author

hi Uma,

Please try:

Re: Count of table

maximiliano_vel
Partner - Creator III
Partner - Creator III

Create a Straight Table with one dimension: $Table

Two Expresions:

  1. Sum($Rows)
  2. Sum($Fields)

Regards

Anonymous
Not applicable
Author

Yes you need to give below statement after loading all tables.

Let vNooftable = NUM(NoOfTables());

NoOfTables() is qlikview function ,counts tables loaded in to qliview memory.

maxgro
MVP
MVP

Qlikview has some interesting system fields you can use to get the names and count of tables, fields, etc

and also make chart

1.png

If I understand you can use $Table and $Field

1.png

Not applicable
Author

My question was:

the table name ' a ' is from a sql db  which has 4,500 records.

in line  i am just giving the table name

Anonymous
Not applicable
Author

please elaborate on your question,its not clear

maxgro
MVP
MVP

and you want to count the number of

- fields or records?

where?

- in the sql db or after you load the tables in the qlik db?

and if you loaded 30 tables in your qlik db

do you want to count the records or fields

- of the 30 tables

- or of the 20 table name you have in in inline

?

Not applicable
Author

I have a table     'a'  from  sql  db  which has 4,500 records.

like that I have 20  tables  from a1 to a20  each of which has 4,500 records

now  I  want to give the names in in line  and see   how many total no of columns are there in each table.

        dynamically taking the table names  and processing it into  for loop for count of columns  for each table name.I even have them in  .qvd  formate.

        If you suggest me  which works good that really hepls me  either inlilne or any query  by using qvds

maxgro
MVP
MVP

// table name (and also filename for qvd)

T:

load * inline [

tablename

a11

a12

source

T

];

for i=0 to NoOfRows('T')-1                                    // start loop on tables (files)

  let table=Peek('tablename', $(i), 'T');

  let file = '$(table)' & '.qvd';                                   // qvd has the same name as table and suffix .qvd

  trace table=$(table);

  trace file=$(file);

  let numoffields=QvdNoOfFields ('$(file)');     // num of fields of a qvd file

  

  F:

  load

  '$(table)' as tablename,

  '$(numoffields)' as numoffields

  AutoGenerate 1;

NEXT;