Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

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
Valued Contributor II

Re: Loading only Field Names with no data

Hi,

Try Below Script  helpful   for U

Load * Resident tablename  where 1=2;

try this script.

Regards,

Perumal.A

6 Replies
gussfish
Contributor II

Re: Loading only Field Names with no data

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
Valued Contributor II

Re: Loading only Field Names with no data

Hi,

Try Below Script  helpful   for U

Load * Resident tablename  where 1=2;

try this script.

Regards,

Perumal.A

Not applicable

Re: Loading only Field Names with no data

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

Re: Loading only Field Names with no data

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

Regards.

Not applicable

Re: Loading only Field Names with no data

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

Regards.

Not applicable

Re: Loading only Field Names with no data

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

Regards.