Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear QV's,
I just need your opinion/idea for the below scenario which I came across in one of my recent development.
I've loaded the fields from DB and stored into QVD. The script is very simple as below.
EMPLOYEE:
Load NAME as EMP_NAME,
ID,
DEPT as DEPARTMENT;
SQL select * from EMPLOYEE.INFO;
Store EMPLOYEE into EMPLOYEE.qvd(qvd);
The requirement is to store the meta data(only field names) into separate qvd.
Currently we're doing this as below.
MetaData:
LOAD * INLINE [
SourceField , MetaSourceTable , QVDField ,QVDFieldDescription
NAME , EMPLOYEE , EMP_NAME ,Employee Name
ID , EMPLOYEE , ID ,Employee ID
DEPT , EMPLOYEE , DEPARTMENT ,Department of the Employee
];
Call StoreQVDMetaData;
'StoreQVDMetaData' is the sub Routine(qvs file) in which we have scripts to write the Meta table information into QVD.
The problem here is each time I need to manually hardcode the loaded fields& Tables into my Inline table which is bit time consuming if I've 20+ fields in my table.
Could you guys please let me know if there are any functions/procedure I can use to get the loaded fields automatically into my meta data table.I know that I cannot automate Field Description so I thought of removing this from meta data table. The only thing I need is to get fields and table name from already loaded table by having any loop or something.
Kindly post your ideas.
Thanks!
- JAY
Would the System Fields be of use ?
Below pasted in from the Help.
In addition to the fields extracted from the data source, system fields are also produced by QlikView. These all begin with "$" and can be displayed in list boxes much like ordinary fields. System fields are typically created during Script execution, are primarily used as an aid in document design.
Perform the following steps:
The system fields are now available as any other fields.
The following system fields can be displayed:
QlikView can automatically create a pivot table that makes use of the system fields.The table is called System Table and contains the two dimensions $Field and $Table and the expression only([$Field]). The system table is sorted according to frequency by default. The system table object is not available for the QlikView Server clients (AJAX and Plugin clients).
Perform the following steps:
Thanks a lot for your input Bill !!!
I guess, system table will return only the QV table name. Is there any option for getting DB source table and columns?
Meanwhile I'm just analyzing the feasibility by using system tables to accomplish this. This is a great idea in need.