8 Replies Latest reply: Aug 25, 2014 8:22 PM by Marco Wedel RSS

    Prefix column headings

      Good morning All,

       

      Can anyone advise how I can prefix column headings with a certain letter or letters in my upload script e.g. if I am prefixing using the letter F, Date would be translated to FDate.

       

      Thank you.

       

      Regards

        • Re: Prefix column headings

          You Can give the label to the particular column as you want.

          • Re: Prefix column headings

            Hi Herbert

             

            Can you please provide some live examples so that i can figure out the issue and based upon the comments i will rep you. as you said below comment in you previous one

             

            If i am prefixing using the letter F, Date would be translated to FDate.

             

            But how do you required in your project i mean is that some Text or Label do you required as  prefix. also you can follow the below steps

             

            go to the property and where you title Text is appear you can put the Prefix where ever you required. i have attached the screen for the Caption information where you can add the words

            • Re: Prefix column headings
              Ashfaq Mohammed

              Hi

               

              In script try below

               

              Load

              F1,

              F2,

              Date as FDate;

              from test.qvd;

               

              Regards

              ASHFAQ

              • Re: Prefix column headings
                ISHFAQUE AHMED

                Dear Herbert,

                 

                Here are the possible ways to rename the fileds.

                 

                Method 1: Using AS

                --------------------------------

                Directory;

                LOAD Year13 AS test,

                     Year14,

                     Sale13,

                     Sales14

                FROM

                [..\..\ExcelSheet\FYear.xlsx]

                (ooxml, embedded labels, table is Sheet1);

                 

                Method 2: Using Alias

                --------------------------------

                ALIAS Year13 AS test;

                Directory;

                LOAD Year13,

                     Year14,

                     Sale13,

                     Sales14

                FROM

                [..\..\ExcelSheet\FYear.xlsx]

                (ooxml, embedded labels, table is Sheet1);

                 

                Method 3: Using Rename Field

                -------------------------------------------------

                Directory;

                LOAD Year13,

                     Year14,

                     Sale13,

                     Sales14

                FROM

                [..\..\ExcelSheet\FYear.xlsx]

                (ooxml, embedded labels, table is Sheet1);

                RENAME Field Year13 to test;

                 

                 

                Kind regards,

                Ishfaque Ahmed

                • Re: Prefix column headings
                  Nils Morris

                  Hi

                  Apart from Ishfaques answer you could also use the Qualify and UnQualify statements.

                  These will add the table name to all the fields within that table. Fields that you don'twant to have this prefix will have to be Unqualfied. This might not be what you are looking for. Maybe if you explain why you want to rename or add a prefix we could suggest the best solution for you.

                  • Re: Prefix column headings
                    Marco Wedel

                    test data

                     

                    DateColumn2Column3
                    01/01/2014ssdfsfdssgdd
                    01/02/2014fdsfddfgfd
                    01/03/2014fdsfdsdf
                    01/04/2014dsgfsdgfdgfd
                    • Re: Prefix column headings
                      Marco Wedel

                      Hi,

                       

                      one possible generic solution might be also:

                       

                       

                       

                      QlikCommunity_Thread_130573_Pic1.JPG.jpg

                      QlikCommunity_Thread_130573_Pic2.JPG.jpg

                       

                      tabFields:
                      CrossTable (Field, FieldName)
                      LOAD 1, *
                      FROM [http://community.qlik.com/thread/130573]
                      (html, codepage is 1252, no labels, table is @1)
                      Where RecNo()=1;
                      
                      mapFields:
                      Mapping LOAD
                        FieldName,
                        'F'&FieldName
                      Resident tabFields;
                      
                      DROP Table tabFields;
                      
                      tabData:
                      LOAD *
                      FROM [http://community.qlik.com/thread/130573]
                      (html, codepage is 1252, embedded labels, table is @1);
                      
                      RENAME Fields using mapFields;
                      
                      

                       

                      hope this helps

                       

                      regards

                       

                      Marco