Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello All,
Is there a way i can pull a specific field name from the qvds and the qvd paths from different folders and store it in a qvd.
E.G: i have 40 qvds in which 35 qvds have a field called Status. I want to create a qvd which contains information about the fieldname, qvdname and qvdpath.
Expected output:
FieldName | Qvdname | Path |
Status | apple | lib: //abc/123/ |
Status | ball | lib://efg/abc/ |
you may need to read the QVD's xml headers to get the information.
1) call DoDir ('lib://Data'); //Mention correct path here where you have all QVD folders in below code .
2) where lower(trim("FieldName")) like '*status*'; // If you want the fields name just as status then no need to mention wildcard ,you can simply use 'status' in below code
sub DoDir (Root)
for each Ext in 'qvd'
for each FoundFile in filelist (Root&'/*.' &Ext)
FileList:
LOAD
mid('$(FoundFile)',1,index('$(FoundFile)','/',-1)) as FilePath,
SubField('$(FoundFile)','/',-1) as QvDName,
"FieldName"
FROM [$(FoundFile)]
(XmlSimple, table is [QvdTableHeader/Fields/QvdFieldHeader]);
next FoundFile
next Ext
for each Dir in dirlist (Root&'/*' )
call DoDir (Dir)
next Dir
end sub
call DoDir ('lib://Data');
Fields:
NoConcatenate
Load *
Resident FileList
where lower(trim("FieldName")) like '*status*';
Drop Table FileList;
.
Hello Dandaanilreddy,
I guess this is not what you need, but maybe a qvd viewer solves your problem.
An application of a qvd viewer is served by @rwunderlich at his blog:
https://qlikviewcookbook.com/2020/06/qviewer-version-4-is-here/
you may need to read the QVD's xml headers to get the information.
1) call DoDir ('lib://Data'); //Mention correct path here where you have all QVD folders in below code .
2) where lower(trim("FieldName")) like '*status*'; // If you want the fields name just as status then no need to mention wildcard ,you can simply use 'status' in below code
sub DoDir (Root)
for each Ext in 'qvd'
for each FoundFile in filelist (Root&'/*.' &Ext)
FileList:
LOAD
mid('$(FoundFile)',1,index('$(FoundFile)','/',-1)) as FilePath,
SubField('$(FoundFile)','/',-1) as QvDName,
"FieldName"
FROM [$(FoundFile)]
(XmlSimple, table is [QvdTableHeader/Fields/QvdFieldHeader]);
next FoundFile
next Ext
for each Dir in dirlist (Root&'/*' )
call DoDir (Dir)
next Dir
end sub
call DoDir ('lib://Data');
Fields:
NoConcatenate
Load *
Resident FileList
where lower(trim("FieldName")) like '*status*';
Drop Table FileList;
.
It Worked. Thanks a lot. 🙂 🙂
Glad that it worked..Cheers!!