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

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Writing status to a txt file while loading

Hi All,

I have a complex app which does the qvd creation. This app generates qvds that will be used to load other apps. The script has numerous pre-calculations so that the qvd will have precalculated dimensions and these can be used in other apps.

The biggest challenge is we are on an oudated HW and has to live with that for some time.

The qvd creation take 12-18 hrs .

What I am trying to do is create a custom status report(txt) and keep apending it.

Is there any way to create/update an existing file using the QVW load script?

ex.

2012-12-10 08:00:00 AM: Load process started

2012-12-10 08:01:00 AM: Order QVD creation started

2012-12-10 08:30:00 AM: Order QVD creation completed

2012-12-10 08:40:00 AM: YTD BIN calc started

2012-12-10 10:40:00 AM: YTD BIN calc finished

2012-12-10 10:45:00 AM: Wrote YTD BIN table to QVD

.

.

.

.

.

and so on

Thanks,

Aji Paul.

Labels (1)
1 Solution

Accepted Solutions
Miguel_Angel_Baeyens

Hi Aji,

Yes, it does indeed need the log file. There is no other option in QlikView to write a custom logfile.

Hope that helps.

Miguel

P.S.: Well, that's not actually true. You do can store whatever you want in a custom ("log") file by using the autogenerated load, it seems quite cumbersome to me, but anyway:

Customers:

LOAD *

FROM Customers;

Log:

LOAD Time,

     Action

FROM PersonalLogFile.txt (txt);

CONCATENATE (Log) LOAD Timestamp(Now()) AS Time,

     'Customers table loaded' AS Action

AUTOGENERATE 1;

STORE Log INTO PersonalLogFile.txt (txt);

DROP TABLE Log;

Invoices:

LOAD *

FROM Invoices;

Log:

LOAD Time,

     Action

FROM PersonalLogFile.txt (txt);

CONCATENATE (Log) LOAD Timestamp(Now()) AS Time,

     'Invoices table loaded' AS Action

AUTOGENERATE 1;

STORE Log INTO PersonalLogFile.txt (txt);

DROP TABLE Log;

// and so on

View solution in original post

10 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Is the log file that's created when you check the Generate Logfile option on the General tab of the properties screen insufficient?


talk is cheap, supply exceeds demand
Not applicable
Author

store * from tabella into share\file.txt(txt,delimiter';')

Not applicable
Author

Thanks Gysbert!

Not really I need a specific custom file. I will be use this to report status and eventually wanted to use it for automated  system monitoring & performance tuning

Not applicable
Author

Marco,

Thanks for the reply

I am not looking to store the table , rather write custom log file after each user defined step is completed

Thanks,

Aji paul

Miguel_Angel_Baeyens

Hi,

Then use the TRACE keyword in the script after each instruction. That will write in the script whatever you want, for example:

IF vDate > Today() THEN

     TRACE Timestamp(Now()) & 'Entered IF';

ELSE

     TRACE Timestamp(Now()) & 'ELSE';

END IF

LOAD *

FROM Customers;

TRACE Timestamp(Now()) & 'Customers loaded';

You can use any function or variable along with the TRACE keyword.

Hope that helps.

Miguel

Not applicable
Author

Thanks Miguel!

But TRACE writes  to the log file , right?

Miguel_Angel_Baeyens

Hi Aji,

Yes, it does indeed need the log file. There is no other option in QlikView to write a custom logfile.

Hope that helps.

Miguel

P.S.: Well, that's not actually true. You do can store whatever you want in a custom ("log") file by using the autogenerated load, it seems quite cumbersome to me, but anyway:

Customers:

LOAD *

FROM Customers;

Log:

LOAD Time,

     Action

FROM PersonalLogFile.txt (txt);

CONCATENATE (Log) LOAD Timestamp(Now()) AS Time,

     'Customers table loaded' AS Action

AUTOGENERATE 1;

STORE Log INTO PersonalLogFile.txt (txt);

DROP TABLE Log;

Invoices:

LOAD *

FROM Invoices;

Log:

LOAD Time,

     Action

FROM PersonalLogFile.txt (txt);

CONCATENATE (Log) LOAD Timestamp(Now()) AS Time,

     'Invoices table loaded' AS Action

AUTOGENERATE 1;

STORE Log INTO PersonalLogFile.txt (txt);

DROP TABLE Log;

// and so on

Not applicable
Author

Thanks Miguel,

So I think the options I have are

  •   "may be" prepend the log by CUSTOM_LOG and then extract those lines alone
  • use of VB Macro or so?

Thanks,

Aji Paul.

Miguel_Angel_Baeyens

Sorry Aji Paul,


I was editing the post while you were replying to it. Check the ammended post.

Yes, you can prepend those lines then use a QVW to read only lines that match that CUSTOM_LOG stamp. And likely VBScript, although my skills go no further...

Miguel