Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Highlighted

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

Tags (3)
1 Solution

Accepted Solutions
evan_kurowski
Valued Contributor

Re: FieldName() with IterNo()/While?

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

Re: FieldName() with IterNo()/While?

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