Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

List of field names of a table

Hi all,

I'm getting an empty table from Hive, only with the field names.

I need to create a list with all the field names.

I want to use a loop.

and QvdNoOfFields function.

can somebody assist?

regards,

Boris

1 Solution

Accepted Solutions
whiteline
Honored Contributor II

Re: List of field names of a table

Hi.

QvdNoOfFields - returns the number of fields for the QVD file.

The usage could be something like this:

Let fieldsCount =   QvdNoOfFields($(fileName))

LOAD

     QvdFieldName($(fileName), rowno()) as Fields

Autogenerate($(fieldsCount));

If you get the empty table with a query, you can use 'CrossTable' functionality of QlikView or 'Transformation step' to transpose the table.

2 Replies
whiteline
Honored Contributor II

Re: List of field names of a table

Hi.

QvdNoOfFields - returns the number of fields for the QVD file.

The usage could be something like this:

Let fieldsCount =   QvdNoOfFields($(fileName))

LOAD

     QvdFieldName($(fileName), rowno()) as Fields

Autogenerate($(fieldsCount));

If you get the empty table with a query, you can use 'CrossTable' functionality of QlikView or 'Transformation step' to transpose the table.

Sokkorn
Honored Contributor

Re: List of field names of a table

Hi Boris,

You may try this with ListBox

1. Create a list box to list all table name. Right click on blank sheet -> New Sheet Object -> List Box -> Click on drop down list then select on <Expression> (last item at the bottom) -> Use $Table in expression

2. Create another list box to list all field name. Right click on blank sheet -> New Sheet Object -> List Box -> Click on drop down list then select on <Expression> (last item at the bottom) -> Use $Field in expression

After that you can select Table name and get associate field in your next list box

Untitled.png

Regards,

Sokkorn

Community Browser