1 Reply Latest reply: Sep 1, 2014 3:26 AM by Evan Kurowski RSS

    FieldName() with IterNo()/While?

    Marco Wedel

      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