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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
hugmarcel
Specialist
Specialist

Load SystemField Content of $Field into Table

Hi

is it possible to load the content of $Field into a Table, e.g.

x:

load $FIELD autogenerate 1;

or similar?

thx - Marcel

1 Reply
swuehl
MVP
MVP

Not 100% sure, but I believe the system fields like $Field will not be accessible prior script finished execution.

But you can access all field names loaded using the table functions in your script:

Table Functions

The table functions return information about previously loaded data tables.

FieldName(nr ,'TableName')

Returns the name of the field with the specified number within a previously loaded table.

If the function is used within a load statement, it must not reference the table currently being loaded.

Examples:

LET a = FieldName(4,'tab1');

T1:
Load a, b, c, d from abc.csv
T2:
Load FieldName (2, 'T1') Autogenerate 1;

FieldNumber('field ' ,'TableName')

Returns the number of a specified field within a previously loaded table.

If the function is used within a load statement, it must not reference the table currently being loaded.

Examples:

LET a = FieldNumber('Customer','tab1');

T1:
Load a, b, c, d from abc.csv
T2:
Load FieldNumber ('b', 'T1') Autogenerate 1;

NoOfFields([ 'TableName ' ])

Returns the number of fields in a previously loaded table.

Examples:

LET a = NoOfFields('tab1');

Load *, NoOfFields( ) from abc.csv;

NoOfRows('TableName ' )

Returns the number of rows (records) in a previously loaded table.

If the function is used within a load statement, it must not reference the table currently being loaded.

Examples:

LET a = NoOfRows('tab1');

Load * from abc.csv where NoOfRows( )<30;

NoOfTables()

Returns the number of tables previously loaded.

TableName( 'TableNumber' )

Returns the name of the table with the specified number.

If the function is used within a load statement, it must not reference the table currently being loaded.

TableNumber( 'TableName' )

Returns the number of the specified table.

If the function is used within a load statement, it must not reference the table currently being loaded.

There are some examples here in the forum how to iterate over all tables, all field names, something like

FOR t = 0 TO NoOfTables() -1

  LET vTableName = TableName(t);

  // Loop through all fields/columns within the table

  FOR vColumnCounter = 1 TO NoOfFields(vTableName)

  LET vFieldName = FieldName(vColumnCounter, vTableName);

  // DO SOMETHING

  NEXT

NEXT