2 Replies Latest reply: Jan 12, 2014 8:45 PM by Sokkorn Cheav RSS

    List of field names of a table

    Boris Kacevich

      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

        • Re: List of field names of a table
          whiteline _

          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.

          • Re: List of field names of a table
            Sokkorn Cheav

            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