Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
QlikWorld Online 2021, May 10-12: Our Free, Virtual, Global Event REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
wally_walton
Contributor II
Contributor II

Display contents of a file based on selection

Hi there,

I have a table in Qlik that contains details of servername, processname and gatewayID.

I also have a network folder with many files that follow a naming convention. For example:

servername_processname_gatewayID.txt

Based on a users selection in Qlik of servername, processname and gatewayID I would like to use a 'Text and Image' object (or other I'm open to suggestions) to display the contents of the corresponding file.

I'm open to quick and dirty solutions if anyone has any ideas?

cheers

Andrew

1 Solution

Accepted Solutions
Quy_Nguyen
Specialist
Specialist

Hi,
What do you have in the text file? If they just text and you want to display all, you can simply load it in a table and use 'Text and image object' to display.
For example, I am loading all txt file in my data connection like this (connection properties is dependent on your file)

Data:
LOAD
    @1 as content,
    FileName() as filename, 
    SubField(FileBaseName(),'_',1) As servername,
    SubField(FileBaseName(),'_',2) As processname,
    SubField(FileBaseName(),'_',3) As gateway
FROM [lib://Data/*.txt]
(txt, codepage is 28591, no labels, delimiter is '\t', msq);

Then just create a filter for server, process, gateway and a Text & Image object for the content.

clipboard_image_1.png

I also attached a demo app for you.

View solution in original post

3 Replies
premvihari
Partner
Partner

Hey @wally_walton ,

I have used Media Box for Qlik Sense for .html files but not .txt ,may be you can explore some latest extension in qlik branch.



Quy_Nguyen
Specialist
Specialist

Hi,
What do you have in the text file? If they just text and you want to display all, you can simply load it in a table and use 'Text and image object' to display.
For example, I am loading all txt file in my data connection like this (connection properties is dependent on your file)

Data:
LOAD
    @1 as content,
    FileName() as filename, 
    SubField(FileBaseName(),'_',1) As servername,
    SubField(FileBaseName(),'_',2) As processname,
    SubField(FileBaseName(),'_',3) As gateway
FROM [lib://Data/*.txt]
(txt, codepage is 28591, no labels, delimiter is '\t', msq);

Then just create a filter for server, process, gateway and a Text & Image object for the content.

clipboard_image_1.png

I also attached a demo app for you.

View solution in original post

wally_walton
Contributor II
Contributor II
Author

Thankyou this will work nicely