Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Is there a way to get the field names of tables previously loaded in the load script into a new table? I was thinking of maybe some way of using a cross table and a resident load, but I could be completely off the mark. Basically just looking to get the names of each field as rows of a new table. I know in SQL you can get field values using system schema tables, but unfamiliar if there is a way in QlikView.
Hi,
sure: You can use the NoOfFields() function to find out how many fields the table you have just loaded has and then use the FieldName() function in a loop to add to a new table the name of every field in that table.
Do all that in a FOR EACH loop or in a subroutine if you have several tables to process.
HTH
Best regards,
DataNibbler
Hi,
sure: You can use the NoOfFields() function to find out how many fields the table you have just loaded has and then use the FieldName() function in a loop to add to a new table the name of every field in that table.
Do all that in a FOR EACH loop or in a subroutine if you have several tables to process.
HTH
Best regards,
DataNibbler
You could use table functions like nooffields() and fieldname(). Maybe in a loop through nooftables().
- Marcus
Did you try generating the 'System Table' which has the information on all the tables and fields?
Hi Charles,
Are you trying to then store the Field Names into a qvd file?
Where are you taking the Data from? Is it a DB or a QVD file
Regards
Alan
Hi Charles,
You could try using SQLCOLUMNS;
CONNECT to ......
Test:
SQLCOLUMNS;
STORE Test INTO Test.qvd(qvd);
You will get a file with details of the Tables and fields from the Database you are connecting to.
I hope that helps
Regards
Alan
example image below
I am pulling data from a SQL Server Database, and I would just be storing and using those fields in the QVW itself. It looks like you guys all have great answers. I think that Data nibbler is the best option, and although it is a bit more complex than using the SQLColumns method, it gets only column names that are in my QVW not the whole DB. I really like the SQLColumns feature though, and it opens up a whole bunch of other data that may be useful in the future. Thanks Everyone!