Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
MarcoWedel

FieldName() with IterNo()/While?

Hi,

given this table:

table1:

LOAD Rand() as Field1,

     Rand() as Field2,

     Rand() as Field3

AutoGenerate 10;

does anybody know, why this code delivers no FieldNames:

tabFields:

LOAD IterNo() as FieldNumber,

     FieldName(IterNo(), 'table1') as FieldName

AutoGenerate 1

While IterNo() <= NoOfFields('table1');

QlikCommunity_Thread_xxx_Pic1.JPG.jpg

while this does:

FOR i = 1 to NoOfFields('table1')

  tabFields:

  LOAD $(i) as FieldNumber,

      FieldName($(i), 'table1') as FieldName

  AutoGenerate 1;

NEXT i;

QlikCommunity_Thread_xxx_Pic2.JPG.jpg

?

thanks for any ideas

regards

Marco

1 Solution

Accepted Solutions
evan_kurowski
Specialist
Specialist

I'm only getting results for the FieldName() function when it evaluates once per load statement and not once per row.  Maybe it has set-analysis like limitations?

Interesting post Marco, would've expected that first set of syntax to be ok, it seems like you're passing correct parameters.

View solution in original post

1 Reply
evan_kurowski
Specialist
Specialist

I'm only getting results for the FieldName() function when it evaluates once per load statement and not once per row.  Maybe it has set-analysis like limitations?

Interesting post Marco, would've expected that first set of syntax to be ok, it seems like you're passing correct parameters.