Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
new_guy
Contributor III
Contributor III

Using variables and inline

for each vFile in FileList ('lib://Test/*.qvd')

	Let vFileName = Replace(SubField('$(vFile)','/',-1),'.qvd','');

Meta:

LOAD
    '$(vFileName)'	AS FileName,
    TableName,
    CreateUtcTime,
    SourceFileSize

FROM [$(vFile)]
(XmlSimple, table is QvdTableHeader);
   
next;

Let vTableName = TableName(1);

CommentField:
mapping LOAD * inline [
Field,Comment
TableName, $(vTableName)
CreateUtcTime, Erstelldatum
];

comment fields using CommentField;

CommentTable:
mapping LOAD * inline [
Table,Comment
$(vTableName), Metadaten
];
comment tables using CommentTable;

store Meta into 'lib://Test\Meta.qvd';

Hello,

I want to use CommentField and CommentTable functions to put comments into meta data of my qvd. In general this works fine, but I want to generalize my code to maybe use it for more than the specific table. I've tried to do this by using variables. When I want to use them with my inline load the variable is not working. Any suggestions or work arounds to solve this? 

 

Greetings

Marcel 

1 Solution

Accepted Solutions
tresesco
MVP
MVP

It seems that the issue is with the TableName(). Try index 0 instead of 1 and see.

Let vTableName = TableName(0);

View solution in original post

1 Reply
tresesco
MVP
MVP

It seems that the issue is with the TableName(). Try index 0 instead of 1 and see.

Let vTableName = TableName(0);