Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

File Function Attribute

I am trying to find what is the use of Attribute (filename, attributename) Function. But I am not getting a clear idea from the Manual.

Can some one please explain this function?

Thanks in advance

3 Replies
Chanty4u
MVP
MVP

Hi,

File Functions in Script

The file functions (only available in script expressions) return information about the table file which is currently being read. These functions will return NULL for all data sources except table files (Exception: ConnectString( )).

Click on the functions that you would like to know more about:

Attribute(filename, attributename)

Returns the value of the meta tags of different file formats, e.g. MP3, WMA, WMV and JPG files, as text.

Filename is the name of a media file including path, if needed.

Attributename is the name of a meta tag.

If the file filename does not exist, is not a supported file format or does not contain a meta tag named attributename, null will be returned.

A large number of meta tags can be used, e.g. ‘Artist’ or ‘Date Picture Taken’. The supported tags can automatically be generated in the script. The keyboard shortcut for this generation is Ctrl + Q,J,P,G for jpg files (keep the Ctrl key pressed while typing the QJPG combination), Ctrl + Q,M,P,3 for mp3 files and Ctrl + Q,W,M,A for wma files.

Note!
You can only read meta tags saved in the file according to the relevant specification, for example ID2v3 for MP3 files or EXIF for JPG files, not meta information saved in the Windows File Explorer.

Example:

Attribute('File', 'Title') as X,

returns the mp3 tag 'title' in field X in each record

Anonymous
Not applicable
Author

Thanks Chanty

oknotsen
Master III
Master III

If your question is now answered, please flag the correct answer with Correct Answer.

If not, please make clear what part of this topic you still like help with .

May you live in interesting times!