Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Loading only Field Names with no data

Hi Everyone,

How are you all?

Can someone please tell me how do I load only the fieldnames in a table from a resident table.

I need no data. All I need are the fieldnames(Names allocated in the resident table).

Thanks

1 Solution

Accepted Solutions
perumal_41
Partner - Specialist II
Partner - Specialist II

Hi,

Try Below Script  helpful   for U

Load * Resident tablename  where 1=2;

try this script.

Regards,

Perumal.A

View solution in original post

6 Replies
gussfish
Creator II
Creator II

Hi,

there are a couple of helpful functions you'll find in the Table

Functions section of the Reference Manual:

*

FieldName(n,'TableName') - gives you the name of the (n)th field

in your table.

*

NoOfFields('TableName') - gives you the number of fields in your

table

So, you should be able to use these together to load-in the names of all

your table's fields.

Angus.

perumal_41
Partner - Specialist II
Partner - Specialist II

Hi,

Try Below Script  helpful   for U

Load * Resident tablename  where 1=2;

try this script.

Regards,

Perumal.A

Not applicable
Author

The where clause

Where RecNo() = 0;

also worked to load only tables and fields with no data and returned this

28-01-2012 17-39-42.png

If you need to work with the table names and field names in QV objects (i.e. list boxes) then use $Table and $Field system fields.

In this example I counted number of unique values in each field.

28-01-2012 17-32-55.png

Cheers

P

Not applicable
Author

Thanks so much. That was the answer I was looking for.

Regards.

Not applicable
Author

Thanks Angus, so much. You answer was really helpful.

Regards.

Not applicable
Author

Thanks Pavol fpr your prompt response. You suggestion worked for me.

Regards.