Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
vardhancse
Specialist III
Specialist III

How to import .MSG files in to qlikview

Hi All,

Have requirement is that need ti import .msg files in to qlikview and create some reports.

Can any one help me out.

6 Replies
Anonymous
Not applicable

can you upload a sample file.

vardhancse
Specialist III
Specialist III
Author

Hi Nitin,

Like I am trying to upload the mails we received in to the qlikview and do some analytics on the same.

1.  Like mail subject area

2. Body

3. To Address

4. From Address

and all 

pgrenier
Partner - Creator III
Partner - Creator III

Good morning,

.msg files are not as nicely structured as one might expect. And one of the issues you might experience with the loading of the data is the fact that lines from the email body might look like header data, and start with From:, To:, Date:, Subject:, Reply-To:, etc,

Anyhow, you could start of with this simple script and try to add extra layers of filtering on top of the first step:

// The first statement should create a table with three fields named @1, @2 and @3

_tmp:

LOAD *

From (txt, codepage is 1252, no labels, delimiter is '\t', msq, no eof);

// Here we filter out fields that are unrelated tp those we want to keep

_tmp2:

LOAD Subfield(@1, ': ', 1) as Header, Subfield(@1, ': ', 2) as Info

Resident _tmp

Where WildMatch(@1, 'From: *', 'To: *', 'Date: *', 'Subject: *');

DROP Table _tmp;

THis works fine with one message. If you have several, it would be best to wrap this up in a DoDir (you can find this in the QlikView help) where you could assign a incremental number to each message read. Then, using the CrossTable instruction, you could have your self a nice table with the appropriate fields ready for analysis.

Hope this guides you in the appropriate direction,

Regards,

Philippe

petter
Partner - Champion III
Partner - Champion III

Depending on how extensive this type of analysis will be you might have a benefit of using a third-party commercial solution to handle this type of unstructured data:

    QVSource has a very nice solution that cover amongst some 40+ connectors mailboxes (IMAP/POP) which

    most mail products today are set up to use as protocols.

    You find QVSource both on QlikMarket and they have their own website  [ www. qvsource . com ]

If this is too much on not something you have a budget for you could also use Regular Expressions from QlikView. You will have to call on VBScript-Functions in Macros to be able to use it from your Load Script.

mwscott1
Creator
Creator

This worked great to get the To, From, Date, and Subject. Is there any way to also pull in the Body of the email?

boopeshj
Partner - Creator II
Partner - Creator II

Hi @mwscott1  Do you have any update on reading a body ?